This is more a Java question than a Drools specific problem. <br><br>You have several producers, running in threads, parallel or (more or less) one<br>after the other. You have one consumer, the thread running the single session.<br>
Consuming consists of accepting the fact and inserting it into the session; then<br>fireAllRules must be called; then the Consumer is ready for the next fact.<br><br>Look into java.util.concurrent. One object implementing BlockingQueue&lt;?&gt;<br>
is what you need for communication between producers and the consumer.<br>You&#39;ll have to figure out the details, depending on the runtime parameters<br>of your application, i.e., arrival frequency, average processing time by the<br>
Engine, etc.<br><br>-W<br><br><br><div class="gmail_quote">On 22 October 2010 08:10, Ayush <span dir="ltr">&lt;<a href="mailto:ayush.vatsyayan@alcatel-lucent.com">ayush.vatsyayan@alcatel-lucent.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Thanks for the reply.<br>
<br>
Can you please elaborate on it?<br>
<br>
Well we are facing issues keeping same session and entry point alive through<br>
out the application.<br>
<br>
As each event will be received as a new thread in my application so when I&#39;m<br>
calling the class which inserts into session and fire-all rules then it&#39;s<br>
also called as new thread and when called it again initializes the session.<br>
I tried to prevent it by not calling session.dispose() and making it static.<br>
For the 1st thread it works fine but for the second thread when I insert<br>
event into entry-point I get the exception due to concurrent modification.<br>
<br>
How can I implement it so that the session and entry-point is initialized<br>
only once and every new event, which is a new thread, will be inserted into<br>
the same entry-point? Also I want that prevoius facts and events should be<br>
in drools memory because I&#39;m working on previous alarms as well?<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Error-Inserting-events-into-drools-fusion-stream-tp1746213p1750771.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Error-Inserting-events-into-drools-fusion-stream-tp1746213p1750771.html</a><br>

Sent from the Drools - User mailing list archive at Nabble.com.<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>