Hi Garrett,

The persistence is very pluggable. I'd suggest to copy SingleSessionCommandService, remove all JTA code and then manage transactions declaratively using Spring.

Best regards,
Michal


2009/8/14 Garrett Conaty <garrett@conaty.net>
Hi there,

Has anyone been successful with Drools 5.1 and persistent processes?  I've been debugging for quite a while now and not sure if the code was meant to run in a container.

I'm using Spring 2.5, Drools 5.1, and Hibernate 3.3

Specifically:  In SingleSessionCommandService

a) the constructor starts a new UserTransaction regardless if one is already active.  Using Bitronix TM or some other that doesn't support nested transactions causes this to fail

b) The use of 'this.em' as the entity manager across calls to 'execute(GenericCommand<t> command) doesn't work with JTA and Hibernate.  Specifically the Hibernate session is closed when the JTA transaction commits.  Therefore, this.em cannot be reused

c) this.localEm is never used

Anyhow, I'd be happy to supply more information and understand the rationale behind the implementation.  I'm using it on a client project, and willing to fix (if it's actually broken), but I get the feeling I'm the first person to try this in a JTA environment

Thanks,
Garrett
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users