<div class="gmail_quote">2012/3/2 Matteo Cusmai <span dir="ltr">&lt;<a href="mailto:cusmaimatteo@gmail.com">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>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>    }<br><br>-Richard<br>