Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2163

Lifecycle event callback occurs more often than expect

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, 2.1.2, 2.2.1, 2.3.0
    • Fix Version/s: 2.2.1, 2.3.0
    • Component/s: kernel
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              allee8285 Albert Lee
              Reporter:
              allee8285 Albert Lee
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: