Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.0-RC4
-
None
Description
The following observed under JDO...
Parent <->* Child as a 1:m managed relationship.
there are lots of derived properties on the Parent
create a new child object; as it is flushed, then JDO calls back to add the child to the parent's children collection. This is done in RelationshipManagerImpl#process (one of these per entity dirties in the xactn).
The JDO lifecycle callbacks result in EntityChangeTracker being called. This iterates over all properties (or at least those with @Property(entityChangePublishing = ENABLED) implicitly or explicitly. Some of these may be derived, resulting in a call to RepositoryServiceDefault. It has an autoFlush which will cause the transaction to be flushed.
However, JDO is not re-entrant in this respect, and so hits a ConcurrentModificationException upon itself.
~~~
As things stand currently there are two workarounds: either disable autoFlush for repository, or use @Property(entityChangePublishing=...).
This ticket is to introduce a new option, which is to automatically suppress autoflush when EntityChangeTracker is called.
In addition, move RepositoryServiceDefault into persistence.commons, and update the location of its 'disable-auto-flush' property, and introduce a new config property to control this new behaviour.
Attachments
Issue Links
- links to