 <p>There are multiple issues that should be looked at:</p> <ol> <li>Long-running operations should be run asynchronously. If you are using Spring, you can annotate <code>@Async</code>, for instance. Then your transaction is not beholden to network connectivity or browser/HTTP timeouts.</li> <li>Batch operations in Hibernate can be very slow. Even if you set up JDBC batching, and even if you follow the instructions <a href="http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/batch.html" rel="nofollow">in the Hibernate documentation</a>, you are still beholden to the fact that you are using an ORM. ORMS are best used for maintaining state for object-oriented operations, not for batch operations, where any individual object's state is less relevant.</li> <li>Batch operations in Hibernate can be very finicky. For instance, the Hibernate batching documentation fails to note that you need to set additional flags in the configuration to make sure that it batches correctly. See <a href="http://abramsm.wordpress.com/2008/04/23/hibernate-batch-processing-why-you-may-not-be-using-it-even-if-you-think-you-are/" rel="nofollow">this post</a> for details.</li> </ol> <p>At the end of the day, ORMs will always be slower than base SQL. Consider swtiching over to base SQL, maybe concatenating SQL statements so that you have fewer database trips, or using a stored proc, passing bactches of data to the proc and have it run the inserts.</p>