JBoss Community

Can Human Task component work with JTA

created by Patrick Yang in jBPM - View the full discussion

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();

            }

        }



Reply to this message by going to Community

Start a new discussion in jBPM at Community