-
Bug
-
Resolution: Done
-
Major
-
None
-
jBPM 3.2.2
-
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.