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

Lifecycle event callback occurs more often than expect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1, 2.1.2, 2.2.1, 2.3.0
    • 2.2.1, 2.3.0
    • kernel
    • None
    • 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

        1. OPENJPA-2163.trunk.patch
          27 kB
          Albert Lee

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: