I have a curious little problem. I have a service that needs to create 2000 records in the database, minimum on various tables. While it would be nice to have them run in the same transaction, the performance gets to be really bad around 400-600 inserts.
For some reason, the inserts go slower and slower. I suppose that Hibernate needs to do some kind of dirty checking... and as the object graphs get more and more complex, it stands to reason that Hibernate has more and more work to do.
This gets really bad because we have one service that basically imports 200 megs of XML data into the database, resulting in about 70,000 inserts. This takes about 1.5 hours to run.
So in Spring, is there a way where I can say, "Keep the hibernate session open, because we want lazy loading and stuff to work... but don't put anything in a transaction?"