You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Albert Lee (Resolved) (JIRA)" <ji...@apache.org> on 2012/04/01 16:42:28 UTC

[jira] [Resolved] (OPENJPA-2163) Lifecycle event callback occurs more often than expect

     [ 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