5 Replies Latest reply on Jun 3, 2014 1:21 AM by swiderski.maciej

    JBPM6-Per process instance strategy in websphere application server 7

    prasadvp

      Hi,

      I'm trying to implement per process instance strategy in my application which uses JBPM 6. I use Bitronix transaction manager and use spring configuration to set it.

       

      Though i was able to successfully configure and test in Tomcat, i'm not successful in Web Sphere application server 7.0  The error i get

       

      Hibernate: select contextmap0_.mappingId as mappingI1_4_, contextmap0_.CONTEXT_ID as CONTEXT2_4_, contextmap0_.KSESSION_ID as KSESSION3_4_, contextmap0_.OPTLOCK as OPTLOCK4_4_ from ContextMappingInfo contextmap0_ where (contextId=? )

      16:28:26.516 [http-bio-8080-exec-1] WARN  o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 904, SQLState: 42000

      16:28:26.516 [http-bio-8080-exec-1] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - ORA-00904: "CONTEXTID": invalid identifier

       

       

      It is very clear from the log is JBPM try to query the "contextmappinginfo" with invalid column name "contextid".

       

      This error does not seem to occur when application deployed in tomcat server.

       

      In CONTEXT.XML of tomcat, Include the line

      <Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory"/>

       

      where as not sure is there any corresponding change to be done when deploying in Web Sphere.

       

      Transaction manager configuration in root-context.xml:

      <bean id="bitronixTransactionManagerConfig" factory-method="getConfiguration" class="bitronix.tm.TransactionManagerServices"  >
      </bean>
      <bean id="bitronixTransactionManager" factory-method="getTransactionManager"
      class="bitronix.tm.TransactionManagerServices" depends-on="bitronixTransactionManagerConfig" destroy-method="shutdown" />

       

         <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" autowire="constructor">

       

       

      <property name="transactionManager" ref="bitronixTransactionManager" />
      <property name="userTransaction" ref="bitronixTransactionManager" />

       

      </bean>

       

      From my persistence.xml file:

       

      <property name="hibernate.transaction.manager_lookup_class"

        value="org.hibernate.transaction.BTMTransactionManagerLookup" />

       

       

      Please let me know why JBPM is querying with invalid column name



        • 1. Re: JBPM6-Per process instance strategy in websphere application server 7
          swiderski.maciej

          fix of all I would not use bitronix on WebSphere as it provides complete implementation of transaction manager and then you should rely on that instead of bitronix.

           

          The issue seems to be somehow related to hibernate not really translating the JPQL query properly but I don't think it should not be container specific. What hibernate version do you use?

           

          HTH

          • 2. Re: JBPM6-Per process instance strategy in websphere application server 7
            prasadvp

            Thank you for the reply.

            To answer your question,
              1.    We use hibernate-core-4.2.0.SP1-redhat-1.jar that comes as a part of JBPM installable.

             

            Regarding transaction manager,

            2. Please let me know what should be the transaction manager to be used. Should we use Container Managed transaction manager as explained in the user guide?

             

            Also, please suggest on this below:

            3. we have only one BPMN process in our application. Is it advisable to use Singleton strategy over per process instance strategy?

            • 3. Re: JBPM6-Per process instance strategy in websphere application server 7
              swiderski.maciej

              Venkata Prasad wrote:

              Regarding transaction manager,

              2. Please let me know what should be the transaction manager to be used. Should we use Container Managed transaction manager as explained in the user guide?

              take a look here for example of persistence.xml used for WebSphere

               

              Venkata Prasad wrote:

              Also, please suggest on this below:

              3. we have only one BPMN process in our application. Is it advisable to use Singleton strategy over per process instance strategy?

              it all depends what your process does but usually it's good idea to start with singleton and once you evaluate it decide if it's good enough or not for your case.

               

              HTH

              • 4. Re: JBPM6-Per process instance strategy in websphere application server 7
                prasadvp

                Thank you Maciej.

                Can you help with me the first question - why Hibernate translating the JPQL incorrectly when deployed in WAS.

                 

                Do i need to check anything else?

                • 5. Re: JBPM6-Per process instance strategy in websphere application server 7
                  swiderski.maciej

                  Since this is WebSphere 7 the cause of the issue might be JPA version supported by WebSphere. By default WAS7 supports only JPA 1 while jbpm 6 users JPA 2. So you would need to have feature pack that brings in JPA 2 capabilities. Other than that I don't see any reason why same hibernate version would work differently on different containers.

                   

                  HTH