1 Reply Latest reply on Mar 12, 2008 5:08 AM by Holger Lins

    configuration for bean managed transaction

    Holger Lins Newbie

      hi all,

      I want to call the jbpm CommandServiceBean in a UserTransaction. But the problem is, jBPM doesn't optain the transaction. So the database values has been changed before the commit.

      Here's the code

      UserTransaction transaction = sessionContext.getUserTransaction();
      transaction.begin();
      //JNDI look up the get CommandServiceBean
      // creation of an Command, to create new process instance and start it.
      commandService.execute(command);
      transaction.commit;
      

      The jbpm.cfg.xml I use.
      ...
       <jbpm-context>
       <service name="persistence">
       <factory>
       <bean class="org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory">
       <field name="isTransactionEnabled"><false /></field>
       </bean>
       </factory>
       </service>
       ...
       </jbpm-context>
      ...

      And the hibernate.cfg.xml

      <!-- JTA transaction properties (begin) -->
       <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
       <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
       <!-- JTA transaction properties (end) -->
      


      I have to admit that I can see the changes in the jbpm database not until the transaction commits. But the changes on the database i call during the workflow are directly persistent.

      How can configure jbpm?

      Thanks in advance.