openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jody Grassel (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (OPENJPA-2405) EntityManager.merge does not work for entity that is managed by another EntityManager
Date Fri, 28 Jun 2013 19:02:20 GMT

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

Jody Grassel edited comment on OPENJPA-2405 at 6/28/13 7:00 PM:
----------------------------------------------------------------

Outside of a tran, a CMTS EM find/query will work, the spec/javadoc just requires that the
entities returned are detached.  Anyways, that really isn't relevant to this JIRA.

And I focused a bit too much on the first part and gave just a partial answer.

As I interpret it, write operations are queued, and it's up to the persistence provider to
decide when to flush them to the database (with em.flush() and tran commit being the "push
everything to the database and do it Now" tools.)  However, because of the Read Committed
isolation policy, a new Entity that has been persisted and made managed by EM#1, even if flushed
() (but not tran committed yet) will not be detectable to any other EM because EM#(not 1)
doesn't share the same JDBC connection.  So EM#1 could conceivably automatically sync every
mutation as it comes in from the application to the database, but it's invisible until that
critical tran.commit() takes place.
                
      was (Author: fyrewyld):
    Outside of a tran, a CMTS EM find/query will work, the spec/javadoc just requires that
the entities returned are detached.  Anyways, that really isn't relevant to this JIRA.
                  
> 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