JBoss Community

Re: Local human task service doesn't participate in a JTA transaction

created by Jboss fan99 in jBPM - View the full discussion

Mauricio,

  I'm not using my own TransactionManager. It's a transaction manager lookup class. May be name of the file is not best.

It's a small lookup class that just returns transaction manager bound in "java:jboss/TransactionManager"

 

By defaut jBPM looks in java:/TransactionManager. That's why this lookup class was added. Below is the code of this class

 

public class MyCompanyTransactionManager implements TransactionManagerLookup {

        public Object getTransactionIdentifier(Transaction transaction){

                return transaction;

        }

        public TransactionManager getTransactionManager(Properties props)

                        throws HibernateException{

                try

                {

                    return (TransactionManager) new InitialContext()

                      .lookup("java:jboss/TransactionManager");

                }

                catch (NamingException e)

                {

                    throw new RuntimeException(e);

                }

        }

        public String getUserTransactionName(){

                return null;

        }

        public static TransactionManager getTransactionManager(){

                return new MyCompanyTransactionManager().getTransactionManager(null);

        }

}

 

Thanks!

Reply to this message by going to Community

Start a new discussion in jBPM at Community