<br> Dean<br><br> Thanks, we will investigate that asap.<br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2007/7/12, Dean Jones <<a href="mailto:dean.m.jones@gmail.com">dean.m.jones@gmail.com</a>>:
</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 <<a href="mailto:tirelli@post.com">tirelli@post.com
</a>> wrote:<br>><br>> Is it possible for you to provide a test case capable of reproducing the<br>> problem?<br>><br>I'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>> At the same time, I would suggest you to not follow such approach in your
<br>> application. Compilation is an extremely heavy process and should not be<br>> done for each request. The ideal approach is to pre-compile (for instance,<br>> we have a contributed ant-task for that) and serialize your rulebase to your
<br>> database or filesystem, or at least, compile it only once and cache it at<br>> runtime.<br>><br>That'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> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646
<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>