Richard,<div><br></div><div>you have hinted at the lack of thread-safety before, and you were kindly asked to provide a demo for this bug, as it ought to be fixed, but so far you haven&#39;t provided one - or did I miss that? Other than this, StatefulKnowledgeSession sure is intended to be thread-safe.</div>
<div><br></div><div>-W</div><div><br><br><div class="gmail_quote">2012/3/4 Richard Calmbach <span dir="ltr">&lt;<a href="mailto:rcalmbac@gmail.com">rcalmbac@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><div class="gmail_quote">2012/3/2 Matteo Cusmai <span dir="ltr">&lt;<a href="mailto:cusmaimatteo@gmail.com" target="_blank">cusmaimatteo@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

i see that there are some other threads that insert new event and some others retract them.<br>How is the thread model?<br></blockquote></div><br></div>Contrary to claims made on this mailing list, StatefulKnowledgeSession is not thread-safe (this may be due to bugs, but bottomline is: it&#39;s not thread-safe). In order to avoid errors due to multi-threading, don&#39;t use fireUntilHalt(), instead synchronize on the session and only call insert() and fireAllRules() while synchronized on the session:<br>

<br>    synchronized (session) {<br>        entryPoint.insert(event);<br>        session.fireAllRules();<br>    }<span class="HOEnZb"><font color="#888888"><br><br>-Richard<br>
</font></span><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></div>