It's not the transactional behaviour that is causing your memory problems. It is the size of your Hibernate session. By default Hibernate only flushes its session at commit time. When you manage your transactions at the application level, the session keeps growing and growing. What you call the database handling the transactions, is actually just autocommit behaviour causing Hibernate to flush for each statement. It's useless in your situation though.
The solution to your problem would be to do a flush of your Hibernate session from time to time. This causes Hibernate to send the SQL requests needed to synchronize the database and your Hibernate session. If you have Spring manage your transactions at the application level, a flush does not automatically imply a commit. After the flush you can clear your session, in order to free up the memory used by the session.
HTH
Jurgen
|