Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-1307

jBPM tries to use Hibernate transaction even if configured with isTransactionEnabled = false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • jBPM 3.2.2
    • Runtime Engine
    • None

      The method org.jbpm.scheduler.db.DbSchedulerService.deleteTimersByProcessInstance(ProcessInstance) is accessing the Hibernate transaction even if jBPM is configured not to use transactions:

      <service name="persistence">
      <factory>
      <bean
      class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
      <field name="isTransactionEnabled">
      <false />
      </field>
      <field name="isCurrentSessionEnabled">
      <true />
      </field>
      </bean>
      </factory>
      </service>

      This causes a serious problem when you're using jBPM inside a JTA environment and you want to control JTA transactions by yourself. For instance, we're using Spring to manage transactions a JBoss Transactions as the JTA implementation. We are not using JNDI in any way, but when we try to call processInstance.end(), a call to org.jbpm.scheduler.db.DbSchedulerService.deleteTimersByProcessInstance(ProcessInstance) is performed and Hibernate tries to create a new JTATransaction by querying an empty JNDI InitialContext.

      The only workaround we could find is the one outlined here:
      http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117325#4117325
      that is, subclassing JobSession in order to use Spring TransactionSynchronizationManager.

            aguizar_jira Alejandro Guizar (Inactive)
            mauromol_jira Mauro Molinari (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: