Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B833910B4D for ; Fri, 28 Jun 2013 19:02:20 +0000 (UTC) Received: (qmail 38556 invoked by uid 500); 28 Jun 2013 19:02:20 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 38510 invoked by uid 500); 28 Jun 2013 19:02:20 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 38501 invoked by uid 99); 28 Jun 2013 19:02:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jun 2013 19:02:20 +0000 Date: Fri, 28 Jun 2013 19:02:20 +0000 (UTC) From: "Jody Grassel (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (OPENJPA-2405) EntityManager.merge does not work for entity that is managed by another EntityManager MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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