After executing actions, the actions (e.g. EntityInsertAction) will be moved from ActionQueue.inserts etc. to ActionQueue.executions to stay there until the transaction completes. Because they do have a reference to the instance being saved, they prevent that instance from being garbage collected. Isn't it possible to clear the instance field after execution? For example the EntityInsertAction needs the entity just for getting the id. Can't the id be retrieved direcly after execution?

I ask, because I tried to insert many new objects to the database and tried with Session.flush() and Session.evict() to get rid of these objects each 1000 objects, because the memory usage was too high. But for the above reason I had no chance to succeed. The workaround was to commit the session more often, but this breaks transactional behaviour.

Any thoughts?

Markus Heiden


_______________________________________________
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Reply via email to