You need it for the post commit insert event.
But we could optimize that if there is no such event.
On Nov 9, 2007, at 21:21, Markus Heiden wrote:
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(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev