I might be putting too simplistic an interpretation on this, but this is what the Javadoc says for StatelessKnowledgeSession<br><br>&quot;StatelessKnowledgeSession provides a convenience API, wrapping 
StatefulKnowledgeSession. It avoids the need to
 call dispose(). Stateless sessions do not support
 iterative insertions and fireAllRules from Java code, the act of 
calling execute(...) is a single
 shot method that will internally instantiate a 
StatefulKnowledgeSession, add all the user data and execute user 
commands, call fireAllRules, and then
 call dispose().&quot;<br><br>So I&#39;m not sure why you just wouldn&#39;t just 
directly use a StatefulKnowledgeSession instead of trying to re-use a 
stateless one. You can then update the Facts via their handles and 
update or retract and reinsert as needed.<br>
<br>Cheers,<br><br>Pat<br><br><div class="gmail_quote">On Tue, Oct 26, 2010 at 3:50 PM, Bruno Freudensprung <span dir="ltr">&lt;<a href="mailto:bruno.freudensprung@temis.com">bruno.freudensprung@temis.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
Hi,<br>
<br>
According to what I&#39;ve read so far, you can reuse Stateless sessions.<br>
In particlar I&#39;ve seen unit tests creating a Stateless session in a<br>
@BeforeClass method, then this session was re-used across multiple tests<br>
methods &quot;pushing&quot; different data-sets into that unique session instance<br>
using commands (created with the org.drools.command.CommandFactory class).<br>
<br>
Regards,<br>
<br>
Bruno.<br>
<br>
espen a écrit :<br>
&gt; Hi,<br>
&gt;<br>
&gt; we have an application with a lot of rules in a cached rulebase. When we<br>
&gt; profile our application we see that about 30% of the time is used in<br>
&gt; rulebase.newStatlessSession(). The time is basically used loading classes.<br>
&gt;<br>
&gt; The question is, is it possible to create a pool of StalessSessions and<br>
&gt; reuse them, or will this create problems.<br>
&gt;<br>
&gt; Regards<br>
&gt; Espen<br>
&gt;<br>
<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>
</blockquote></div><br>