• Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.1.1, 2.2.0, 2.3.0
    • Fix Version/s: 2.2.1, 2.3.0
    • Component/s: kernel
    • Labels:


      I encountered a NPE[2] today when using the LiteAutoDetach[1] configuration property. The steps required to cause this problem is as follows:

      • Configure LiteAutoDetach for your PU.
      • Find a non-transactional Entity.
      • Clear the EntityManager.
      • Begin / commit transaction.

      The problem is that LiteAutoDetach doesn't properly clean up the EntityManager while it is performing lite detachment. State is left in BrokerImpl._pending set which is then incorrectly used post em.clear. It also appears that there are a number of other BrokerImpl datastructures that should have been cleaned up on clear / detachall.

      [2] Caused by: <openjpa-2.2.0-SNAPSHOT-r422266:1244602 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: null
      at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(
      at org.apache.openjpa.kernel.LocalManagedRuntime.commit(
      at org.apache.openjpa.kernel.BrokerImpl.commit(
      at org.apache.openjpa.kernel.DelegatingBroker.commit(
      at org.apache.openjpa.persistence.EntityManagerImpl.commit(
      ... 24 more
      Caused by: java.lang.NullPointerException
      at org.apache.openjpa.Customer.pcProvideField(
      at org.apache.openjpa.kernel.StateManagerImpl.provideField(
      at org.apache.openjpa.kernel.StateManagerImpl.preFlush(
      at org.apache.openjpa.kernel.PDirtyState.beforeFlush(
      at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(
      at org.apache.openjpa.kernel.BrokerImpl.flush(
      at org.apache.openjpa.kernel.BrokerImpl.flushSafe(
      at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(
      ... 28 more

        Issue Links


          Rick Curtis created issue -
          Rick Curtis made changes -
          Field Original Value New Value
          Link This issue relates to OPENJPA-1545 [ OPENJPA-1545 ]
          Rick Curtis added a comment -

          Committed revision 1292034 to trunk.

          Rick Curtis added a comment - Committed revision 1292034 to trunk.
          Rick Curtis added a comment -

          Committed revision 1292040 to 2.2.x.

          Rick Curtis added a comment - Committed revision 1292040 to 2.2.x.
          Rick Curtis made changes -
          Status Open [ 1 ] 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 Resolved Resolved
          1h 9m 1 Rick Curtis 21/Feb/12 21:28
          Resolved Resolved Closed Closed
          230d 21h 8m 1 Albert Lee 09/Oct/12 18:36


            • Assignee:
              Rick Curtis
              Rick Curtis
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: