I am sporadically getting a ConcurrentModificationException during a 50 user load test. This appears to be happening while a lazy-loaded collection is being batch fetched. Is this supposed to be happening or is this a bug? I would assume, maybe incorrectly, that once the batch fetching started changes to the underlying database would not affect any of the collections Hibernate is working with. Perhaps if the fetch were operating withing a read-only transaction this would not happen?
Hibernate version:
3.2.0.CR2
Mapping documents:
Here is the mapping for the collection:
<set
name="taskCardGroupAssignments"
lazy="true"
inverse="true"
cascade="all-delete-orphan"
sort="unsorted"
batch-size="10"
>
<key
column="TASK_CARD_EXECUTION_ID"
>
</key>
<one-to-many
class="fleetcycle.domain.es.taskCardAssignment.TaskCardGroupAssignment"
/>
</set>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Caused by: java.util.ConcurrentModificationException
at org.apache.commons.collections.SequencedHashMap$OrderedIterator.next(SequencedHashMap.java(Compiled Code))
at org.hibernate.util.IdentityMap.entrySet(IdentityMap.java(Compiled Code))
at org.hibernate.engine.BatchFetchQueue.getCollectionBatch(BatchFetchQueue.java(Compiled Code))
at org.hibernate.loader.collection.BatchingCollectionInitializer.initialize(BatchingCollectionInitializer.java(Compiled Code))
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java(Compiled Code))
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java(Compiled Code))
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java(Compiled Code))
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java(Compiled Code))
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java(Inlined Compiled Code))
at org.hibernate.collection.PersistentSet.toArray(PersistentSet.java(Inlined Compiled Code))
at sun.reflect.GeneratedMethodAccessor227.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
... 65 more
Name and version of the database you are using:
Oracle 9i
The generated SQL (show_sql=true):
don't have
Debug level Hibernate log excerpt:
don't have
|