<br>&nbsp;&nbsp; Is it possible for you to provide a test case capable of reproducing the problem?<br><br>&nbsp;&nbsp; At the same time, I would suggest you to not follow such approach in your application. Compilation is an extremely heavy process and should not be done for each request. The ideal approach is to pre-compile (for instance, we have a contributed ant-task for that) and serialize your rulebase to your database or filesystem, or at least, compile it only once and cache it at runtime.
<br><br>&nbsp;&nbsp; []s<br>&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;">
Hello folks,<br><br>I&#39;m experiencing some odd behaviour from Drools (or maybe the Eclipse<br>compiler) when load-testing my application, and wondered if anyone<br>else had experienced the same issue. I have a web service which, for
<br>every request, loads in rules from the database, creates a<br>org.drools.lang.descr.PackageDescr and then uses this to create a<br>org.drools.rule.Package. The code is something like:<br><br>PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
<br>PackageBuilder builder = new PackageBuilder(conf);<br>PackageDescr packageDescr = new PackageDescr(&quot;MyRulebaseName&quot;);<br>populatePackageDescr(packageDescr);<br>builder.addPackage(packageDescr);<br>Package _package = 
builder.getPackage();<br>return _package;<br><br>This code gets run every request. The populatePackageDescr() method<br>adds imports, globals, functions and rules to the PackageDescr. My<br>load-test just repeatedly calls the same rulebase, so
<br>populatePackageDescr() will be doing exactly the same thing for each<br>request. Occasionally (normally once or twice per 100 requests) I get<br>a rule compilation error (the exact error varies from request to<br>request) whereas most of the time the same rule compiles fine. This
<br>makes me suspect a thread-safety issue in either the PackageBuilder or<br>the compiler (I&#39;m using the eclipse compiler).<br><br>Initially, I suspected a problem in my<br>populatePackageDescr(packageDescr) method, but I think I&#39;ve ruled this
<br>out. There is nothing stateful in this method, and I&#39;ve tried dumping<br>the XML representation of the packageDescr immediately after<br>populating it; it looks fine to me and is exactly the same whether<br>compilation succeeds or and fails.
<br><br>Has anyone done this kind of thing successfully under a heavy load?<br><br>Thanks,<br><br>Dean.<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></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>