[rules-users] drools flow persistence doesn't work with spring jta - bug/TODO code in SingleSessionCommandService#initTransactionManager

gs76pl gstasica at pacemetrics.com
Wed Apr 20 10:57:54 EDT 2011


hi,

i've been trying to setup my drools flow persistence layer to use spring
transaction management (JTA) but it looks like some parts of the code are
missing in 5.1.1 rendering the whole idea impossible.

Whats happening is that when my transaction manager calls commit it gets
NullPointerException because jpm variable in SingleSessionCommandService has
never been set. It looks like it should be set in initTransactionManager
method in line 233 but all that this line is a comment that reads:
...else{
// configure spring for JPA and distributed transactions 
}

So is there any way to have spring managing JTA transactions? 
Sorry but it's been over a week for me trying to have drools persistence
working and after all the problems so far i'm considering jbpm5 as something
in a more "production ready state"

i've found similar thread here
http://drools.46999.n3.nabble.com/Drools-Spring-JPA-JTA-td2024942.html but
till now nobody replied to it with any explanation

below my spring config

<bean id="droolsFlowEntityManagerFactory"
	class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
	p:dataSource-ref="droolsFlowDataSource"
p:persistenceUnitName="org.drools.persistence.jpa"

p:persistenceXmlLocation="classpath:/config/droolsflow/jpa/persistence.xml">
	<property name="jpaVendorAdapter">
		<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
			p:showSql="true" p:generateDdl="false" />
	</property>
</bean>	

<bean id="bitronixTransactionManagerConfig"
factory-method="getConfiguration"
class="bitronix.tm.TransactionManagerServices">
	<property name="serverId" value="spring-btm" />
	<property name="warnAboutZeroResourceTransaction" value="true"></property>
</bean>	

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

<bean id="droolsFlowTransactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
	<property name="transactionManager" ref="bitronixTransactionManager" />
	<property name="userTransaction" ref="bitronixTransactionManager" />
</bean>	

--
View this message in context: http://drools.46999.n3.nabble.com/drools-flow-persistence-doesn-t-work-with-spring-jta-bug-TODO-code-in-SingleSessionCommandService-inr-tp2843098p2843098.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list