1 Reply Latest reply on Apr 15, 2008 6:06 AM by David Holbrook

    jBPM with Seam: Transaction problem

    Stijn Cremers Novice

      I'm using jBPM in combination with Seam.
      I works fine...
      But aparently does jBPM not use the same transaction service as the other code.


      This is not good!, because if there goes something wrong, one transaction service will rollback, but the other won't, so i get bad data.


      the persistence.xml


      <persistence xmlns="http://java.sun.com/xml/ns/persistence" 
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
                   version="1.0">
                   
         <persistence-unit name="KvvDossiers">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>java:/KvvDossiersDatasource</jta-data-source>
            <properties>
               <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
               <!-- property name="hibernate.hbm2ddl.auto" value="update"/ -->
               <property name="hibernate.show_sql" value="true"/>
               <property name="hibernate.format_sql" value="true"/>
               <property name="jboss.entity.manager.factory.jndi.name" value="java:/KvvDossiersEntityManagerFactory"/>
            </properties>
         </persistence-unit>
          
      </persistence>
      



      the jbpm.cfg.xml


      <jbpm-configuration>
      
        <jbpm-context>
          <service name="persistence">
             <factory>
                <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
                   <field name="isTransactionEnabled"><false/></field>
                </bean>
             </factory>
          </service>
          <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
          <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
          <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
          <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
          <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
        </jbpm-context>
      
      </jbpm-configuration>
      



      the hibernate.cfg.xml



      <hibernate-configuration>
        <session-factory>
      
          <property name="show_sql">true</property>
          <property name="connection.datasource">java:/KvvDossiersDatasource</property>
          <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
          <property name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
          <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
          <property name="hbm2ddl.auto">update</property>
          ...
        </session-factory>
      </hibernate-configuration>