As part of the rules evaluation, more objects are inserted into the working memory. Even though I just insert 1 object after creating a session, rule outcomes inside lead to more objects to be inserted. <br>Correct me if I am wrong, but I was under the impression that a stateless wouldnt be able to automatically fire rules when we objects are inserted dynamically<br>
<br>Thanks<br><br>Jai<br><br><div class="gmail_quote">On Feb 4, 2008 1:05 AM, Anstis, Michael (M.) <<a href="mailto:manstis1@ford.com" target="_blank">manstis1@ford.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>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">IMHO, you might achieve better scalability and resilience
if you can make the working memory stateless.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">I assume your "service" to be a web-service over
stateless-HTTP and not a service exposed over a stateful
protocol.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Cheers,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Mike</font></span></div><br>
<blockquote style="margin-right: 0px;">
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma" size="2"><div><b>From:</b> <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>On Behalf Of </b>Jai
Vasanth<br></div><b>Sent:</b> 01 February 2008 22:05<br><b>To:</b> Rules Users
List<br><b>Subject:</b> Re: [rules-users] Using the drools as the backend
engine for a service<br></font><br></div><div><div></div><div>
<div></div>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" target="_blank">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 vlink="purple" link="blue" lang="EN-US">
<div>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;">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; color: navy; font-family: Arial;"></span></font> </p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;">Rulebase =
once</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;">Working memory =
per user/transaction</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;"></span></font> </p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;">-Michael</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color: navy; font-family: Arial;"></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-weight: bold; font-size: 10pt; font-family: Tahoma;">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>
<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" target="_blank">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></div></div></blockquote></div>
<br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank">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>