openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey" <plins...@gmail.com>
Subject Re: ConcurrentModificationException at org.apache.openjpa.kernel.BrokerImpl
Date Wed, 10 Oct 2007 17:18:57 GMT
Note that this also applies if you are accessing the same persistent
entity (i.e., the same Java reference) in multiple threads.

As Kevin points out, this is supported by OpenJPA if you set the
openjpa.Multithreaded option, and has value in some circumstances, but
could also be a sign of an unintentional inter-thread dependency.

-Patrick

On 10/10/07, Kevin Sutter <kwsutter@gmail.com> wrote:
> Filipchik,
> Is there any possibility that you are accidentally using your EntityManagers
> in multiple threads?  A simple test would be to turn on the
> openjpa.Multithreaded property to true (it's false by default).  If your
> test succeeds with this property set, then you are probably accessing your
> EntityManagers via multiple threads.  Whether this is by accident or on
> purpose would still be a question to answer...
>
> Kevin
>
> On 10/10/07, Filipchik Alexandr <afilipchik@artezio.ru> wrote:
> >
> > Hello.
> >
> >
> >
> > I'm trying to use OpenJPA in my project. I use Liferay based on Toncat
> > as front-end.
> >
> >
> >
> > I use OpenJPA 1.0.0
> >
> > Today I have got strange exception -
> >
> > 10:35:55,785 ERROR ConcurrentModificationException at
> > java.util.HashMap$HashIterator.nextEntry(HashMap.java:787)  at
> > java.util.HashMap$KeyIterator.next(HashMap.java:823) at
> > org.apache.openjpa.kernel.BrokerImpl$ManagedCache.dirtyCheck(BrokerImpl.
> > java:4612)
> >
> >         at
> > org.apache.openjpa.kernel.BrokerImpl$ManagedCache.access$000(BrokerImpl.
> > java:4352) at
> > org.apache.openjpa.kernel.BrokerImpl.hasTransactionalObjects(BrokerImpl.
> > java:3731)
> >
> >         at
> > org.apache.openjpa.kernel.BrokerImpl.setDirty(BrokerImpl.java:3848) at
> > org.apache.openjpa.kernel.StateManagerImpl.setPCState(StateManagerImpl.j
> > ava:207)
> >
> >         at
> > org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1
> > 532) at
> > org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1
> > 471)
> >
> >         at
> > org.apache.openjpa.kernel.StateManagerImpl.dirtyCheck(StateManagerImpl.j
> > ava:808) at
> > org.apache.openjpa.kernel.BrokerImpl$ManagedCache.dirtyCheck(BrokerImpl.
> > java:4612)
> >
> >         at
> > org.apache.openjpa.kernel.BrokerImpl$ManagedCache.access$000(BrokerImpl.
> > java:4352) at
> > org.apache.openjpa.kernel.BrokerImpl.hasTransactionalObjects(BrokerImpl.
> > java:3731)
> >
> >         at
> > org.apache.openjpa.kernel.BrokerImpl.setDirty(BrokerImpl.java:3848) at
> > org.apache.openjpa.kernel.StateManagerImpl.setPCState(StateManagerImpl.j
> > ava:207)
> >
> >         at
> > org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1
> > 532) at
> > org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1
> > 471)
> >
> >         at
> > org.apache.openjpa.kernel.StateManagerImpl.dirtyCheck(StateManagerImpl.j
> > ava:808) at
> > org.apache.openjpa.kernel.BrokerImpl$ManagedCache.dirtyCheck(BrokerImpl.
> > java:4612)
> >
> >         at
> > org.apache.openjpa.kernel.BrokerImpl$ManagedCache.access$000(BrokerImpl.
> > java:4352)
> >
> >
> >
> >
> >
> > It happens only, when I deploy application on portal, and only when
> > service is first-time accessed.
> >
> > All tests work fine.
> >
> >
> >
> > Exception throws in get method
> >
> >
> >
> > Alexander Filipchik
> >
> > Lead Developer
> >
> >
> >
> >
>


-- 
Patrick Linskey
202 669 5907

Mime
View raw message