<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=914070209-04022008><FONT face=Arial
color=#0000ff 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 class=914070209-04022008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=914070209-04022008><FONT face=Arial
color=#0000ff 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 class=914070209-04022008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=914070209-04022008><FONT face=Arial
color=#0000ff size=2>Cheers,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=914070209-04022008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=914070209-04022008><FONT face=Arial
color=#0000ff size=2>Mike</FONT></SPAN></DIV><BR>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>Jai
Vasanth<BR><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>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="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV lang=EN-US vlink="purple" link="blue">
<DIV>
<P><FONT face=Arial color=navy 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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Rulebase =
once</SPAN></FONT></P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Working memory =
per user/transaction</SPAN></FONT></P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">-Michael</SPAN></FONT></P>
<P><FONT face=Arial color=navy 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 width="100%" SIZE=2>
</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 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></BLOCKQUOTE></BODY></HTML>