openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Lee (Created) (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2163) Lifecycle event callback occurs more often than expect
Date Tue, 27 Mar 2012 20:58:27 GMT
Lifecycle event callback occurs more often than expect

                 Key: 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:!default.jspa
For more information on JIRA, see:


View raw message