[hibernate-dev] Should CollectionEntry::snapshot Include The Results Of Queued Operations?

John Walker johnw at newconceptsdev.com
Mon Jan 21 16:38:24 EST 2013


In hibernate 3.6.10, CollectionEntry::snapshot is sometimes initialized
after queued operations (SimpleAdd, Clear,etc) are processed.  As a result,
the snapshot can contain transient entities, and does not accurately reflect
the state of the collection in the database.

Is this intentional, or should the CollectionEntry::snapshot be taken
*after* all queued operations have been performed?   

For an example of what I'm talking about, see
org.hibernate.engine.loading.CollectionLoadContext::endLoadingCollection(Loa
dingCollectionEntry, CollectionPersister).

This method calls endRead(), which for some collections (like PersistentBag)
applies queued operations.    Then it calls
CollectionEntry::postInitialize(),  which takes the initial snapshot of the
collection.

Sorry to keep bugging you guys about this. (I posted a similar question
about the same problem.)  I've been having trouble finding good sources of
information about Hibernate archecture/how things are "supposed" to  work.

Thanks!

-John




More information about the hibernate-dev mailing list