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 6247B967E for ; Tue, 27 Mar 2012 22:04:50 +0000 (UTC) Received: (qmail 34102 invoked by uid 500); 27 Mar 2012 22:04:50 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 34065 invoked by uid 500); 27 Mar 2012 22:04:50 -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 33966 invoked by uid 99); 27 Mar 2012 22:04:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2012 22:04:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2012 22:04:47 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B09963491C8 for ; Tue, 27 Mar 2012 22:04:26 +0000 (UTC) Date: Tue, 27 Mar 2012 22:04:26 +0000 (UTC) From: "Albert Lee (Work started) (JIRA)" To: dev@openjpa.apache.org Message-ID: <1445035513.25928.1332885866724.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <45772617.25653.1332881907301.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Work started] (OPENJPA-2163) Lifecycle event callback occurs more often than expect 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-2163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Work on OPENJPA-2163 started by Albert Lee. > Lifecycle event callback occurs more often than expect > ------------------------------------------------------ > > Key: OPENJPA-2163 > URL: https://issues.apache.org/jira/browse/OPENJPA-2163 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Affects Versions: 2.0.3, 2.1.2, 2.3.0, 2.2.1 > Reporter: Albert Lee > Assignee: Albert Lee > Fix For: 2.3.0, 2.2.1 > > > A problem was uncovered in a scenario where multiple EntityManager instances created from the same EntityManagerFactory, and each instance is initialized with a new instance of a LifecycleListener instance, i.e. > final EntityManager em = factory.createEntityManager(); > final EntityManager em2 = factory.createEntityManager(); > ... > MyLifecycleListener l1 = new MyLifecycleListener(); > MyLifecycleListener l2 = new MyLifecycleListener(); > ... > ((OpenJPAEntityManagerSPI)em).addLifecycleListener(l1, null); > ((OpenJPAEntityManagerSPI)em2).addLifecycleListener(l2, null); > When life cycle event occurs for a specific entity manager, all the listeners created under the emf are being invoked. The expected behavior is only the listener registered in the em from which the life cycle events are related should be called. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira