| ConcurrentModificationException prior to updating entity. [message #506072] |
Tue, 05 January 2010 15:22  |
beamso Messages: 7 Registered: January 2010 |
Junior Member |
|
|
Hi.
I'm attempting to update an existing J2EE application from using Toplink on glassfish v2.1.1 to using EclipseLink on glassfish v3. The application is using bean-managed persistence with explicit transactions.
When creating/updating entities, JPA queries may be executed in the transaction prior to EntityManager.persist() or EntityManager.merge() being called on the object being created/updated. This code flow worked perfectly under Toplink. But under EclipseLink I'm getting ConcurrentModificationExceptions.
I've done some googling on the exception and the first point made was making sure that the EntityManager wasn't accessed from multiple threads. The EntityManager is stored in a ThreadLocal and is only accessed on the one thread.
Any ideas on what's wrong here would be great.
Following is the stacktrace:
Caused by: java.util.ConcurrentModificationException
at java.util.IdentityHashMap$IdentityHashMapIterator.nextIndex(IdentityHashMap.java:715)
at java.util.IdentityHashMap$KeyIterator.next(IdentityHashMap.java:804)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.calculateChanges(UnitOfWorkImpl.java:606)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeChanges(RepeatableWriteUnitOfWork.java:352)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:696)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.performPreQueryFlush(EJBQueryImpl.java:1182)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:404)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:669)
at net.beamso.project.persistence.controllers.JpaDao.getFirstResultFromQuery(JpaDao.java:95)
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.14304 seconds