1 Reply Latest reply on Apr 9, 2012 12:12 PM by bcavlin

    jBPM 5.2 transaction issues in JBoss 5.1

    bcavlin

      Hi,

       

      I was wondering if anyone else had these issues using JBoss 5.1 and jBPM 5.2. I am receiving these errors when trying jBPM service (please note that service works, but these errors are reported):

       

      1.  java.sql.SQLException: You cannot set auto commit during a managed transaction!

       

      2.  [CachedConnectionManager] Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6

       

      3. org.jbpm.persistence.processinstance.ProcessInstanceInfo @PreUpdate public void update is never fired in JBoss

       

      Also, please note that JUnit tests that I have using same code and same data (with exception of who provides transaction) works just fine.

       

      Any help or suggestion is appreciated.

       

      Thanks

       

      ----

       

      To rephrase the question, is it possible at all to have statless EJB that starts transaction to initiate and call jBPM engine (providing that I will call Persistence.createEntityManagerFactory within the transaction to create StatefulKnowledgeSession)? Could this be cause of my problems, and if yes, what are possible alternative strategies to resolve it.

       

      Thanks

       

       

       

      ----Partial solution found

       

      For @PreUpdate to work I actually removed this setting that I had in the peristance.xml <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/> (was not reading documentation before setting this ) and I have set EJB transaction to NEVER for now. I still need to have this transaction (EJB) started first though, so if anyone has any suggestion?

       

      Thanks

        • 1. Re: jBPM 5.2 transaction issues in JBoss 5.1
          bcavlin

          I have resolved issue by adding this to persistence.xml

           

          <property name="jboss.entity.manager.factory.jndi.name" value="java:/jBPMManagerFactory"/>

           

          I ma obtaining factory like this:

           

          emf = (EntityManagerFactory) new javax.naming.InitialContext().lookup("java:/jBPMManagerFactory"); instead of Persistence.createEntityManagerFactory(properties.getProperty("persistence.persistenceunit.name"));

           

          Seems to work fine for now.

          1 of 1 people found this helpful