[rules-users] Problem with DroolsFlow transaction

HMandic trbuhom at net.hr
Tue Sep 14 10:33:30 EDT 2010


Anyone?

I found out that JBoss AS doesn't know which TransactionManager to use here.
I have:

Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, myEmFactory);
env.set(EnvironmentName.TRANSACTION_MANAGER, XXXX);
session = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase,
null, env);

So, what goes in place of XXXX in EJB3 application on JBoss 5.1.0.GA?

In persistence.xml I have this line

<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup"/>

in both persistence units (one for "org.drools.persistence.jpa" and the
other for "org.drools.task").


I also tried this:

TransactionManager tm = (TransactionManager) new
InitialContext().lookup("java:/TransactionManager");
env.set(EnvironmentName.TRANSACTION_MANAGER, tm);

but it doesn't work either.

Is this something obvious that I don't see?

Please help, I'm stuck on this for too long...
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Problem-with-DroolsFlow-transaction-tp1439637p1473330.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list