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

    configuration for bean managed transaction

    hlins

      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.

        • 1. Re: configuration for bean managed transaction
          hlins

          Well,

          after thinking about my problem, i think it is not an issue of the persistence service. It's an issue of the "tx"service.

          I looked at the documentation. Nothing!
          I checked the source code -> not really much.

          Can anybody tell me how I can configure this service to use JTA just like the persistence service?