0 Replies Latest reply on Mar 18, 2016 10:51 AM by Sergio Soares

    problemas com Multiplas sessões in RestWorkitemHandler

    Sergio Soares Newbie

      private void configure() {

      runtime.getKieSession()

           .getWorkItemManager()

           .registerWorkItemHandler("Email",    

                     new DupontEmailWorkItemHandler());

           runtime.getKieSession().getWorkItemManager()

           .registerWorkItemHandler("Rest", new RESTWorkItemHandler());

      }

       

      Tenho está classe onde registra o RestWorkitem

      sempre ue tenho mais de uma sessao aberta sempre ocorre o erro

       

      Caused by: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.

      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)

      at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)

      at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:92)

      ... 80 more

      Caused by: javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.persistence.processinstance.ProcessInstanceInfo#at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:1416)

      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1329)

      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)

      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1316)

      at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1510)

      at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:118)

      at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53)

      at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)

      at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)

      at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)

      at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)

      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)

      ... 83 more

      Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.persistence.processinstance.ProcessInstanceInfo#at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:2523)

      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3242)

      at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3140)

      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3470)

      at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:140)

      at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:393)

      at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:385)

      at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:302)

      at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339)

      at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)

      at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1240)

      at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404)

      at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:113)

      ... 89 more

       

       

       

      alguem poderia me ajudar