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

        

Reply via email to