[jboss-user] [JBoss jBPM] - configuration for bean managed transaction

hlins do-not-reply at jboss.com
Tue Mar 11 13:27:57 EDT 2008


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.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135723#4135723

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135723



More information about the jboss-user mailing list