Hibernate

Hibernate, C3P0 and robust database connection handling

Quoting from the official Hibernate docs: "Hibernate's own connection pooling algorithm is, however, quite rudimentary. It is intended to help you get started and is not intended for use in a production system, or even for performance testing. You should use a third party pool for best performance and stability."
And it's all true: you should never (imho not even for development) use the default connection provider.

How to number rows in MySQL

Xaprb published a nice method for creating sequentially increasing identifiers for groups of records in a query.

How to query the memory usage stats from the JVM

People using Hibernate and Sun's JVM usually face the java.lang.OutOfMemoryError: PermGen space message sooner or later (mostly sooner Smiling ). To track down the source of an OutOfMemoryError problem you've to be able to query the amount of total and free memory within each available memory pool (heap and non-heap pools as well). Here's a short code snippet to demonstrate how to do that ...

Batch inserts in Hibernate

A few notes on a couple of gotchas with using batch inserts in Hibernate with a MySQL database.

Syndicate content