<div><br></div> Wolfgang,<div><br></div><div> That is correct. Drools has no control over the fact objects, as it reuses whatever was provided by the application. If those objects are not thread safe and the application is accessing them concurrently, a race condition will happen.</div>
<div><br></div><div> Edson<br><br><div class="gmail_quote">On Tue, Feb 14, 2012 at 2:26 AM, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(I don't want to confuse things by adding to the recent thread on the<br>
user list. And I do hope that I got this right. Please read carefully<br>
and correct me. Thanks.)<br>
<br>
The statement "StatefulKnowledgeSession is thread-safe" must be<br>
annotated with caveats so that users don't overload this basically<br>
simple statement with meaning that isn't logically implied by it.<br>
<br>
StatefulKnowledgeSession is thread-safe means that any two threads<br>
cannot interact in such a way that it would corrupt data protected by<br>
the implementing object. It does not mean that all code executed on<br>
behalf of the data maintained by a Stateful Knowledge Session object<br>
is thread-safe. In particular, the execution of a consequence is not a<br>
critical section from the session's point of view.<br>
<br>
The existence of an activation implies that the LHS conditions are<br>
true for the objects playing a part. As soon as one thread begins<br>
actions based on these preconditions and is on its way to modifying<br>
one or more facts, any other thread doing likewise with any of the<br>
participating objects in this or another RHS is running into a race<br>
condition.<br>
<br>
If a consequence execution is a critical section for some application<br>
object, it is the user's responsibility to achieve proper<br>
synchronisation, either for entire consequences or for individual fact<br>
objects.<br>
<br>
-W<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>