<html><body bgcolor="#FFFFFF"><div>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.)<br><br>GreG</div><div><br>On May 15, 2009, at 14:54, Shannon Lal <<a href="mailto:shannonlal2909@gmail.com">shannonlal2909@gmail.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>Thanks for the response. How would you recommend passing it in? Via the Global Memory or another way?<br><br>Shannon<br><br><div class="gmail_quote">On Fri, May 15, 2009 at 4:50 PM, Greg Barton <span dir="ltr"><<a href="mailto:greg_barton@yahoo.com"><a href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</a></a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
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.<br>
<br>
GreG<br>
<div><div></div><div class="h5"><br>
On May 15, 2009, at 11:42, Shannon Lal <<a href="mailto:shannonlal2909@gmail.com"><a href="mailto:shannonlal2909@gmail.com">shannonlal2909@gmail.com</a></a>> wrote:<br>
<br>
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.<br>
<br>
Thanks<br>
<br>
Shannon<br>
</div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org"><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank"><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org"><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank"><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></a><br>
</blockquote></div><br>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>rules-users mailing list</span><br><span><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></span><br></div></blockquote><br>
</body></html>