4 Replies Latest reply on Aug 17, 2006 9:38 AM by Chris OBrien

    CommandExecuter thread and CMT

    Olivier Debels Newbie

      Hello,

      I'm currently using Jbpm 3.1.1 with CMT configured (by setting 'isTransactionEnabled' to false in my jbpm.cfg.xml).

      Whenever an exception occurs in the command executer thread, I get the exception: "setRollbackOnly was invoked while configuration specifies user managed transactions".

      The reason for this is that in the commandExecuterThread any error is catched by:

      ...
      } catch (Throwable t) {
       // rollback the transaction
       log.debug("command '"+message+"' threw exception. rolling back transaction", t);
      jbpmContext.setRollbackOnly();
      ...
      


      And when the context is closed afterwards (jbpmContext.close()), all services will be closed. Looking at the DbPersistenceServiceProvider code this results in:

      public void close() {
       if ( (session!=null)
       && (transaction==null)
       && (isRollbackOnly)
       ) {
       throw new JbpmException("setRollbackOnly was invoked while configuration specifies user managed transactions");
       }
      ...
      


      Since we have no transaction (we configured it this way) and the isRollbackOnly is true (set by previous code) we get this exception.

      So I seems like the command executor thread is not behaving well when working in a CMT.