Monday, December 10, 2007

Improve Hibernate performance using Bulk

If your application needs to run under heavy stress you can improve a lot the performance using hibernate by using bulk updates.

Hibernate allow you to to write bulk of several SQL insert statements at one time,
To do it you need to open an hibernate session, write a set of sql insert statements or a set of sql update statements (don't mix the insert and the update statements togther), and call session.flush() this would use the DB capabilities to write bulk of sql statments in efficent way.

Hibernate underneath use something like JDBC Batch to implement the bulk updates.

I succeed to write in this way 10,000 rows in 1.5 seconds in Oracle DB Table on a simple Pentium machine.

No comments:


RSS Feeds Submission Directory