3 Replies Latest reply on Oct 7, 2011 3:46 AM by Marie MM

    Can Human Task component work with JTA

    Patrick Yang Newbie

      Hi Krisv,

       

      I am trying to control JBPM5 Process Engine / Human Task / Histroy Log / My own application in one atomic transaction using JTA.

      Currently I already configured Process Engine / Histroy Log  / My own application with JTA (BTM implemenation), but failed to include Human Task in.

      It will always report "A JTA EntityManager cannot use getTransaction()" exception, I tracked the source code, it was because, below code always call getTransaction, and it was not allowed when we config Human Task persistence unit as JTA.

       

       

      Can you give me some suggestion?

       

      Thanks

       

      private void doOperationInTransaction(final TransactedOperation operation) {

              final EntityTransaction tx = em.getTransaction();

              try {

                  if (!tx.isActive()) {

                      tx.begin();

                  }

                  operation.doOperation();

                  tx.commit();

              } finally {

                  if (tx.isActive()) {

                      tx.rollback();

                  }

              }