openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Lee (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (OPENJPA-2405) EntityManager.merge does not work for entity that is managed by another EntityManager
Date Tue, 25 Jun 2013 14:16:22 GMT

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

Albert Lee edited comment on OPENJPA-2405 at 6/25/13 2:16 PM:
--------------------------------------------------------------

Per Spec:
====================
3.2.7.1 Merging Detached Entity State
The merge operation allows for the propagation of state from detached entities onto persistent
entities
managed by the entity manager.
The semantics of the merge operation applied to an entity X are as follows:
........
• If X is a managed entity, it is ignored by the merge operation, however, the merge operation
is
cascaded to entities referenced by relationships from X if these relationships have been annotated
with the cascade element value cascade=MERGE or cascade=ALL annotation.
====================

merge() is for "detached" entity only. If it is "managed", it is IGNORED.....

                
      was (Author: allee8285):
    Per Spec:
====================
3.2.7.1 Merging Detached Entity State
The merge operation allows for the propagation of state from detached entities onto persistent
entities
managed by the entity manager.
The semantics of the merge operation applied to an entity X are as follows:
........
• If X is a managed entity, it is ignored by the merge operation, however, the merge operation
is
cascaded to entities referenced by relationships from X if these relationships have been annotated
with the cascade element value cascade=MERGE or cascade=ALL annotation.
====================

Merge if for "detached" entity only and if it is "managed", it is IGNORED.....

                  
> 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