org.apache.openjpa.persistence.InvalidStateException: Attempt to commit a null javax.transaction.Transaction. Some application servers set the transaction to null if a rollback occurs.

ode-user | Vito | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    TransactionManager error when invoking multiple instances on two ODE engines

    ode-user | 3 years ago | Vito
    org.apache.openjpa.persistence.InvalidStateException: Attempt to commit a null javax.transaction.Transaction. Some application servers set the transaction to null if a rollback occurs.
  2. 0

    Error setting foreign key in jpa entity: You cannot flush unmanaged objects... that have persistent associations to unmanaged objects

    Stack Overflow | 3 years ago | thenaglecode
    org.apache.openjpa.persistence.InvalidStateException: Encountered unmanaged object "au.com.combined.domain.Status-1" in life cycle state unmanaged while cascading persistence via field "au.com.combined.domain.AHistory.status" during flush. However, this field does not allow cascade persist. You cannot flush unmanaged objects or graphs that have persistent associations to unmanaged objects. Suggested actions: a) Set the cascade attribute for this field to CascadeType.PERSIST or CascadeType.ALL (JPA annotations) or "persist" or "all" (JPA orm.xml), b) enable cascade-persist globally, c) manually persist the related field value prior to flushing. d) if the reference belongs to another context, allow reference to it by setting StoreContext.setAllowReferenceToSiblingContext(). FailedObject: au.com.combined.domain.Status-1

    Root Cause Analysis

    1. org.apache.openjpa.persistence.InvalidStateException

      Attempt to commit a null javax.transaction.Transaction. Some application servers set the transaction to null if a rollback occurs.

      at org.apache.openjpa.kernel.BrokerImpl.setRollbackOnlyInternal()
    2. OpenJPA Aggregate Jar
      BrokerImpl.beforeCompletion
      1. org.apache.openjpa.kernel.BrokerImpl.setRollbackOnlyInternal(BrokerImpl.java:1490)
      2. org.apache.openjpa.kernel.BrokerImpl.setRollbackOnly(BrokerImpl.java:1476)
      3. org.apache.openjpa.kernel.DelegatingBroker.setRollbackOnly(DelegatingBroker.java:925)
      4. org.apache.openjpa.persistence.EntityManagerImpl.setRollbackOnly(EntityManagerImpl.java:560)
      5. org.apache.openjpa.persistence.PersistenceExceptions$2.translate(PersistenceExceptions.java:71)
      6. org.apache.openjpa.kernel.BrokerImpl.translateManagedCompletionException(BrokerImpl.java:1896)
      7. org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1830)
      7 frames
    3. Geronimo TxManager :: Transaction
      TransactionManagerImpl.commit
      1. org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
      2. org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
      3. org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
      4. org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
      5. org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
      5 frames
    4. org.apache.ode
      SimpleScheduler$RunJob.call
      1. org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:291)
      2. org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:239)
      3. org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleScheduler.java:512)
      4. org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleScheduler.java:496)
      4 frames
    5. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      5. java.lang.Thread.run(Thread.java:662)
      5 frames