3 Replies Latest reply on Mar 21, 2010 1:55 PM by Maciej Swiderski

    JBPM4 connection problem

    Khaled Talaat Novice

      Hello All,

      I have a problem with JBPM4 when I start a process instance ,I got a warning that the  Connection is not closed and that I should close the connections my self.

      This warning is thrown when I try to start the process instance.

      The code used is as following:

       

      processEngine =  (ProcessEngine)ctx.lookup("java:/ProcessEngine");

      processInstance =   processEngine.getExecutionService().startProcessInstanceById(processDefinitionId);

       

      The stacktrace is showing that this method is the one which opened the connection and didn't close it.

       

      This method is called from a BMT stateful session EJB bean.

        • 1. Re: JBPM4 connection problem
          Maciej Swiderski Master

          Hi,

           

          do you execute jBPM with JTA transactions configured? Seems like some transaction manager issue.

           

          More information about your environment setup would be useful as well.

           

          Cheers,

          Maciej

          • 2. Re: JBPM4 connection problem
            Khaled Talaat Novice

            Thanks Maciej for your fast response.

            I'm using EJB deployed on JBoss AS 5.1 and the database engine is MySQL

            and I want to be able to manage the transaction of the JBPM as a standalone transaction to be able to commit or rollback it from my bean.

            but I think that it is not configured to be a standalone transaction.

            • 3. Re: JBPM4 connection problem
              Maciej Swiderski Master

              In general that should be possible. One of the scenarios of using jBPM is as embedded within application. This means that application will control transaction of jBPM, since it is Hibernate in background that should not be a problem.

               

              In my opinion configuration is the key here, when you setup both your application and jBPM to use JTA transactions then your application and jBPM should be under control of the same transaction manager regardless if they share data source or not.

               

              JTA configuration is delivered with jBPM distribution but (afaik) it is not configured as default one. In dev or user guide there should be some info how to configure JTA support.

               

              HTH

              Maciej