openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arne Limburg (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2405) EntityManager.merge does not work for entity that is managed by another EntityManager
Date Thu, 27 Jun 2013 17:17:20 GMT

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

Arne Limburg commented on OPENJPA-2405:
---------------------------------------

Yes, I know how I could make it work in the test case.
Unfortunately this is not true for real life applications.
The problem occured in a web-app with concurrent requests.
I load the entity within one request and the EntityManager is closed after that request.
In the second request I merge that entity to have an attached instance again.
Unfortunately from time to time the second request comes in when the first is not completely
finished and the first EntityManager is still open. Then the problem occures.

So, until this behavior of OpenJPA is not fixed, I cannot have concurrent requests with JPA?

Btw. I am willing to help fixing this issue.

Is it common sense that the best behavior in the described case would be that OpenJPA simply
copies the state of the entity?
                
> EntityManager.merge does not work for entity that is managed by another EntityManager
> -------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2405
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2405
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.2.3
>            Reporter: Arne Limburg
>         Attachments: OPENJPA-2405.patch
>
>
> EntityManager.merge does not work for entity that is managed by another EntityManager.
Instead of updating that entity OpenJPA tries to persist the entity a second time

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message