[rules-users] Rules and Hibernate Question
Greg Barton
greg_barton at yahoo.com
Fri May 15 21:02:40 EDT 2009
Global is probably how I'd do it. Now, outside the rules you might want to get fancy, like IOC or a ThreadLocal, but inside a global is fine. (unless you're in multithreaded mode with a single hibernate session, which is bad because hibernate sessions are not thread safe.)
GreG
On May 15, 2009, at 14:54, Shannon Lal <shannonlal2909 at gmail.com> wrote:
Thanks for the response. How would you recommend passing it in? Via the Global Memory or another way?
Shannon
On Fri, May 15, 2009 at 4:50 PM, Greg Barton <greg_barton at yahoo.com> wrote:
It depends on your transaction needs. A hibernate session can only encompass one db transaction. So if you need to execute more than one db transaction in one rule firing session, then pass in a hibernate SessionFactory to spawn multiple hibernate Sessions. Otherwise pass in a hibernate Session.
GreG
On May 15, 2009, at 11:42, Shannon Lal <shannonlal2909 at gmail.com> wrote:
I have a question about using Hibernate with Rules. I am wondering if there is some standard practices on how one should reference the Hibernate Session inside a rule. Should this be passed in as a global variable? Is there a better way of doing this? Any advice on this would be greatly appreciated.
Thanks
Shannon
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090515/2c014a4e/attachment.html
More information about the rules-users
mailing list