7 Replies Latest reply on Apr 12, 2006 8:08 AM by Johan Hedin

    Need help with EJB3 and jBPM 3.1 transactions on JBoss 4.0.4

    Johan Hedin Newbie

      Hi all

      I can't get transaction propagation to work with EJB3-RC5, JBoss 4.0.4RC1 and jBPM 3.1. The senario that troubles me is the case where the start of the transaction is in EJB3 SLSB -> token.signal() -> call to the sam EJB3 SLSB (new lookup). I get an error

      2006-04-11 16:21:51,179 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: null
      2006-04-11 16:21:51,179 ERROR [org.hibernate.util.JDBCExceptionReporter] Transaction is not active: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=doloxene.sth.ecare.se/111, BranchQual=, localId=111]; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=doloxene.sth.ecare.se/111, BranchQual=, localId=111])
      


      The jBPM class looks like this

      /**
       * jBPM action for inserting a message from RIS into the DB. The node propagates the
       * process execution further after inserting the message
       * @version $Id$
       */
      public class InsertMessage implements ActionHandler {
      
       protected static Logger logger = Logger.getLogger(InsertMessage.class);
      
       public void execute(ExecutionContext executionContext) throws Exception {
      
       if(logger.isDebugEnabled()) {
       logger.debug("Executing inserting messages");
       }
       String tmPK = (String)executionContext.getVariable(IBConstants.TRANSIENT_MESSAGE_ID_VARIABLE);
       Context context = new InitialContext();
       if(logger.isDebugEnabled()) {
       logger.debug("About to insert message from TransientMessage with id "+ tmPK);
       }
       RISInputManagement rm = (RISInputManagement)context.lookup(RISInputManagement.class.getName());
       rm.insertMessageById(tmPK);
       executionContext.leaveNode();
       }
      }
      


      The EntityManager is injected in the SLSB. jBPM is configurated to disable transactions and the underlaying Hibernate to use JTA transactions. Any clues?



      Thanks In Advance

      Johan Hedin