I must have not been clear, yes I was planning on instantiating the rulebase when the service starts and instantiating a new session for every request.<br><br><br><br>ONCE:<br> <br> RuleBase ruleBase = RuleBaseFactory.newRuleBase();<br>
ruleBase.addPackage( pkg );<br><br>PER REQUEST:<br>Stateful session = ruleBase.newStatefulSession(); (Is this what you were referring to as working memory ? )<br><br><br>I hope that looks ok.<br><br>Thanks<br><br>Jai <br>
<div class="gmail_quote">On Feb 1, 2008 1:37 PM, Michael Rhoden <<a href="mailto:mrhoden@franklinamerican.com">mrhoden@franklinamerican.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">You would likely NOT want to create a
rulebase per session. Most people create working memory per session. Rulebases
should only be loaded once per server (context) in my opinion, and you reload
it as rules changes. Loading a rulebase loads rules from a file, and orders
your rete tree. For our installation that takes several minutes.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Rulebase = once</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Working memory = per user/transaction</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">-Michael</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<div>
<div style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">
<hr align="center" size="2" width="100%">
</span></font></div>
<p><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">
<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] <b><span style="font-weight: bold;">On
Behalf Of </span></b>Jai Vasanth<br>
<b><span style="font-weight: bold;">Sent:</span></b> Friday, February 01, 2008
3:23 PM<br>
<b><span style="font-weight: bold;">To:</span></b> Rules Users List<br>
<b><span style="font-weight: bold;">Subject:</span></b> [rules-users] Using the
drools as the backend engine for a service</span></font></p>
</div><div><div></div><div class="Wj3C7c">
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Hi,<br>
<br>
I am planning on using Drools as the rules engine for a service that I am
building. I am considering instantiating a stateful session for every request
to the service. The RuleBase would be created when the service starts. Is this
the correct way to go about incorporating Drools in a service ? Is
session creation an expensive process and if so are there other efficient ways
of doing so ?<br>
<br>
<br>
<br>
Thanks <br>
<br>
Jai </span></font></p>
</div></div></div>
</div>
<br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a 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>