On 12 August 2011 17:46, FrankVhh <span dir="ltr"><<a href="mailto:frank.vanhoenshoven@agserv.eu">frank.vanhoenshoven@agserv.eu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
The difference between stateful and stateless is basically this:<br>
- Stateful: the engine will be able to reevaluate the rules during<br>
execution, hereby enabling foreward chaining.<br>
- Stateless: engine will not do any reevaluations, the state of the facts<br>
as they come in to the engine, will be considered their fixed state, even if<br>
they are modified.<br></blockquote><div><br>This is not quite right. An org.drools.runtime.StatelessKnowledgeSession is nothing but a simplifying wrapper for a StatefulKnowledgeSession. The wrapper restricts you to "execute", after which it is "game over": the session is a goner. But, while it is doing its rule firing callisthenics it is behaving just like a StatefulKnowledgeSession.<br>
<br>There is, however, a special mode for running a StatelessKnowledgeSesssion: "sequential mode". This, then, results in the restrictions described by Frank, coupled with some performance gains. <br><br>-W<br></div>
</div>