[ 
https://issues.apache.org/jira/browse/OPENJPA-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635260#action_12635260
 ] 

Heiko commented on OPENJPA-398:
-------------------------------

Hi!

I see exactly the same behaviour as described in this bug on 1.2.0.

And yes, in my case, there is a reference to an object of the same class. It's 
a tree of objects. Each object has a @ManyToOne relationship to its parent and 
a @OneToMany relationship to its children. Parents and children are objects of 
the same class.
This exception appears, when I try to add a child to the tree (add-operation on 
the java.util.List of children). 

The exception doesn't occur in the first or second level of the hierarchy, only 
on deeper levels. 
To test, wether concurrency is involved or not, I set openjpa.Multithreaded to 
true, but I got the same exception.
Apart from that, I'm pretty sure, that there is only one thread. 

Using plain JPA in a Swing application (no Spring,...). 

I can make a short example, if it is of interest for you.


> ConcurrentModificationException at org.apache.openjpa.kernel.BrokerImpl
> -----------------------------------------------------------------------
>
>                 Key: OPENJPA-398
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-398
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.0.0, 1.0.1, 1.0.2, 1.1.0
>            Reporter: Alexander
>            Priority: Critical
>
> 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.java:207)
>         at 
> org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1532) 
> at 
> org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1471)
>         at 
> org.apache.openjpa.kernel.StateManagerImpl.dirtyCheck(StateManagerImpl.java: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.java:207)
>         at 
> org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1532) 
> at 
> org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1471)
>         at 
> org.apache.openjpa.kernel.StateManagerImpl.dirtyCheck(StateManagerImpl.java: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
> Transactions are managed by Spring and i use Spring agent.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to