I basically have a singleton factory that feeds the rule base to the session bean. It's cached in a map once the first compile is done so it's pretty quick. I haven't done any load testing but I don't see it being a hot spot. Easy enough to create a pool of them if it does become a bottleneck. This is all EJB3 as well.
<br><br><div><span class="gmail_quote">On 6/25/07, <b class="gmail_sendername">Michael Neale</b> &lt;<a href="mailto:michael.neale@gmail.com">michael.neale@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
ideally there is only one instance of a rulebase, and you create new sessions as needed - presumably with session beans you will have a few instances (which is not ideal, but you can live with it). <br><br><br><div><span class="gmail_quote">

On 6/24/07, <b class="gmail_sendername">Philip Reimer</b> &lt;<a href="mailto:reimer@atb-bremen.de" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">reimer@atb-bremen.de</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br>Hello.<br><br>I&#39;m very new to JBoss rules (or rules engines in general), so please<br>excuse any stupid questions.<br><br>I have to integrate jboss rules into an ejb3 project: expose rules
<br>functionality via a session bean (and probably a web service later).<br><br>I got it basically working but it&#39;s probably not a very elegant<br>solution. Could anyone give me some hints for some best practices when
<br>using rules from within a session bean? Especially, regarding the<br>caching of built rule bases?<br><br>Thanks in advance,<br>Philip<br><br>-----BEGIN PGP SIGNATURE-----<br>Version: GnuPG v1.4.6 (GNU/Linux)<br>Comment: Using GnuPG with Mozilla - 
<a href="http://enigmail.mozdev.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://enigmail.mozdev.org</a><br><br>iD8DBQFGfm6Jzz98eoVPWsQRArJtAJ0RwT/I/PYxZN7LzVSTuejorpGo0gCeJgqX<br>DqgnI1JWcBzOBFsuqSqSVUo=
<br>=26FR<br>-----END PGP SIGNATURE-----<br>_______________________________________________
<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.jboss.org/mailman/listinfo/rules-users
</a><br></blockquote></div><br>
<br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div><br>