To be honest, I am not sure there is a well defined expectation here.

I would say that the logical answer in my opinion would seem to be that 
that snapshot should not contain queued things until after the flush 
that processes them.  But that's just my "gut feel".

Sorry I cannot be more definitive.

By the way, you mention 3.6.  Have you tried with 4.0 or 4.1 to see the 
outcome there?

On 01/21/2013 03:38 PM, John Walker wrote:
> 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
>
>
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

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

Reply via email to