<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">org.drools.StatefulSession has the async* methods, which are thread safe. &nbsp;I'm not sure if&nbsp;org.drools.runtime.StatefulKnowledgeSession.execute(Command&lt;T&gt; command) uses them behind the scenes, though.<br><br>--- On <b>Fri, 11/26/10, Wolfgang Laun <i>&lt;wolfgang.laun@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Wolfgang Laun &lt;wolfgang.laun@gmail.com&gt;<br>Subject: Re: [rules-users] StatefulKnowledgeSession.startProcess not thread-safe ?<br>To: "Rules Users List" &lt;rules-users@lists.jboss.org&gt;<br>Date: Friday, November 26, 2010, 9:33 AM<br><br><div id="yiv269798697">2010/11/26 Esteban Aliverti <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:esteban.aliverti@gmail.com" target="_blank"
 href="/mc/compose?to=esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>&gt;</span><br><div class="yiv269798697gmail_quote"><blockquote class="yiv269798697gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex;">
Are you using the same session? Sessions are not thread-safe in drools.<div><br></div></blockquote><div>Sessions not thread-safe? So how do I run x.fireUntilHalt() in one session and do insert() in other threads? Do I have to synchronize this myself?<br>
-W<br><br><br>&nbsp;</div><blockquote class="yiv269798697gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex;"><div></div><div>Best,&nbsp;<br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
<font color="#888888"><br>Esteban Aliverti<br>- Developer @ <a rel="nofollow" target="_blank" href="http://www.plugtree.com">http://www.plugtree.com </a><br>

- Blog @ <a rel="nofollow" target="_blank" href="http://ilesteban.wordpress.com">http://ilesteban.wordpress.com</a></font><div><div></div><div class="yiv269798697h5"><br>
<br><br><div class="yiv269798697gmail_quote">On Fri, Nov 26, 2010 at 12:12 PM, OptimusPrime <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:the.maxxxx@gmail.com" target="_blank" href="/mc/compose?to=the.maxxxx@gmail.com">the.maxxxx@gmail.com</a>&gt;</span> wrote:<br><blockquote class="yiv269798697gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex;">


<br>
Hello,<br>
<br>
I wrote a micro benchmark in order to test the performance of Drools Flow<br>
5.1.0 in single and multi-threaded environments.<br>
<br>
And I noticed that, when 2 threads call startProcess() at the same time<br>
(Intel Core 2 Duo CPU), the returned process instance IDs are the same.<br>
<br>
I checked the code and it seems there is no locking mechanism in the<br>
org.drools.process.instance.impl.DefaultProcessInstanceManager class for the<br>
id creation.<br>
<br>
Is this a bug or am I missing something ?<br>
<br>
Thanks<br>
<font color="#888888">--<br>
View this message in context: <a rel="nofollow" target="_blank" href="http://drools-java-rules-engine.46999.n3.nabble.com/StatefulKnowledgeSession-startProcess-not-thread-safe-tp1973203p1973203.html">http://drools-java-rules-engine.46999.n3.nabble.com/StatefulKnowledgeSession-startProcess-not-thread-safe-tp1973203p1973203.html</a><br>



Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a rel="nofollow" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a rel="nofollow" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" href="/mc/compose?to=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></div></blockquote></td></tr></table><br>