OpenJPA
  1. OpenJPA
  2. OPENJPA-2163

Lifecycle event callback occurs more often than expect

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 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.

        Activity

        Albert Lee created issue -
        Albert Lee made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Albert Lee made changes -
        Attachment OPENJPA-2163.trunk.patch [ 12520303 ]
        Albert Lee made changes -
        Patch Info Patch Available [ 10042 ]
        Albert Lee made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Albert Lee made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        1h 6m 1 Albert Lee 27/Mar/12 23:03
        In Progress In Progress Resolved Resolved
        4d 16h 38m 1 Albert Lee 01/Apr/12 15:42
        Resolved Resolved Closed Closed
        10s 1 Albert Lee 01/Apr/12 15:42

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development