<br>&nbsp;&nbsp; Dean<br><br>&nbsp;&nbsp; Thanks, we will investigate that asap.<br><br>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/7/12, Dean Jones &lt;<a href="mailto:dean.m.jones@gmail.com">dean.m.jones@gmail.com</a>&gt;:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Edson,<br><br>On 7/12/07, Edson Tirelli &lt;<a href="mailto:tirelli@post.com">tirelli@post.com
</a>&gt; wrote:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;Is it possible for you to provide a test case capable of reproducing the<br>&gt; problem?<br>&gt;<br>I&#39;ve written a quick test case, which is attached. When numberOfThreads==1,<br>everything compiles okay. When numberOfThreads==100, I get function
<br>compilation errors and CompileExceptions from mvel. Clearly there is<br>nothing shared between these threads as a new test class is created<br>per thread. If you synchronise the calls to addPackage() and<br>getPackage() using the class monitor 
i.e.<br><br>synchronized (DroolsLoadTest.class) {<br> builder.addPackage(packageDescr);<br> builder.getPackage();<br>}<br><br>then the problems go away. Hope this helps.<br><br><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;At the same time, I would suggest you to not follow such approach in your
<br>&gt; application. Compilation is an extremely heavy process and should not be<br>&gt; done for each request. The ideal approach is to pre-compile (for instance,<br>&gt; we have a contributed ant-task for that) and serialize your rulebase to your
<br>&gt; database or filesystem, or at least, compile it only once and cache it at<br>&gt; runtime.<br>&gt;<br>That&#39;s very sensible advice. Our situation is slightly different as<br>users are allowed to change the rules used by a running service, so we
<br>need to reflect any changes when a new request comes in. We are<br>planning to apply caching if performance is an issue, but we were<br>trying to assess performance of application under load when this<br>thread safety issue arose.
<br><br>Thanks for your help,<br><br>Dean.<br><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">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646
<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>