Brett Meyer commented on Bug HHH-8083

The issue stems from the indexed collection (List) being extra lazy. Because of this, the PersistentList is not initialized when inserted, so the fix for HHH-5732 is completely skipped.

The absolute easiest fix is to change PersistenceList#add, skipping queuing if the list is inverse. This is a bit hacky and somewhat "wrong" however. It essentially ignores the extra laziness on all indexed collections when an entry is added.

A more correct approach was brought up by Steve Ebersole. I'll take a stab at that first, but will fall back on the above (with a warning) if absolutely necessary.

(05:00:27 PM) sebersole: the alternative is to have a method on collection persister to process queued additions
(05:01:38 PM) sebersole: and to account for that as part of that CollectionEntry transient state
(05:02:04 PM) sebersole: CollectionEntry#hasQueuedOperations
(05:04:23 PM) sebersole: you already saw where most of those hooks would go
(05:04:26 PM) sebersole: org.hibernate.engine.internal.Collections#prepareCollectionForUpdate
(05:04:45 PM) sebersole: CollectionEntry
(05:05:26 PM) sebersole: ActionQueue/CollectionPersister
(05:05:40 PM) sebersole: org.hibernate.event.internal.AbstractFlushingEventListener#flushCollections

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira