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 44130992B for ; Sun, 1 Apr 2012 14:42:54 +0000 (UTC) Received: (qmail 30259 invoked by uid 500); 1 Apr 2012 14:42:53 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 29743 invoked by uid 500); 1 Apr 2012 14:42:52 -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 29714 invoked by uid 99); 1 Apr 2012 14:42:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Apr 2012 14:42:52 +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; Sun, 01 Apr 2012 14:42:49 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D317B35229E for ; Sun, 1 Apr 2012 14:42:28 +0000 (UTC) Date: Sun, 1 Apr 2012 14:42:28 +0000 (UTC) From: "Albert Lee (Resolved) (JIRA)" To: dev@openjpa.apache.org Message-ID: <1473056748.3210.1333291348880.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <45772617.25653.1332881907301.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (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 ] Albert Lee resolved OPENJPA-2163. --------------------------------- Resolution: Fixed > 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 > > Attachments: OPENJPA-2163.trunk.patch > > > 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