<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">KnowledgeBaseImpl also seems to be unsafe because threads get stuck while trying to open a new StatefulKnowledgeSession</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div>org.drools.impl.KnowledgeBaseImpl.newStatefulKnowledgeSession()</span><br><br><div class="gmail_quote">
On Thu, Aug 26, 2010 at 3:49 PM,  <span dir="ltr">&lt;<a href="mailto:rules-users-request@lists.jboss.org">rules-users-request@lists.jboss.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Send rules-users mailing list submissions to<br>
        <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:rules-users-request@lists.jboss.org">rules-users-request@lists.jboss.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:rules-users-owner@lists.jboss.org">rules-users-owner@lists.jboss.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of rules-users digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. CommandFactory.newSetGlobal and scope (Ricardo J. M?ndez)<br>
   2. Re: Stuck Threads (Esteban Aliverti)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Thu, 26 Aug 2010 15:30:47 +0300<br>
From: Ricardo J. M?ndez &lt;<a href="mailto:mendezster@gmail.com">mendezster@gmail.com</a>&gt;<br>
Subject: [rules-users] CommandFactory.newSetGlobal and scope<br>
To: <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
Message-ID:<br>
        &lt;<a href="mailto:AANLkTimLN6duK%2BSMeRuv6ZVUtEhk4B%2BsdYYBxkfXozLu@mail.gmail.com">AANLkTimLN6duK+SMeRuv6ZVUtEhk4B+sdYYBxkfXozLu@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
Hi everyone,<br>
<br>
I&#39;m reading through Michael Bali&#39;s Drools JBoss Rules book as well as the<br>
reference guide, and I&#39;ve got a question of scope about<br>
StatefulKnowledgeSessions.<br>
<br>
I understand that if I call setGlobal on a stateful session, this global<br>
value will be shared for all simultaneous calls to executeRules across all<br>
threads.  I&#39;m looking into CommandFactory, which has a newSetGlobal<br>
method.   From what I gather, a global set via CommandFactory.newSetGlobal<br>
and then executed with a call to<br>
execute(CommandFactory.newBatchExecution(cmds)) would be scoped solely to<br>
that execution, regardless of it is a StatefulKnowledgeSession and there are<br>
other parallel command executions against the same session.<br>
<br>
Can anyone confirm if that is accurate?<br>
<br>
Thanks in advance,<br>
<br>
--<br>
Ricardo J. M?ndez<br>
<a href="http://www.arquetipos.co.cr/" target="_blank">http://www.arquetipos.co.cr/</a><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.jboss.org/pipermail/rules-users/attachments/20100826/d694c41b/attachment-0001.html" target="_blank">http://lists.jboss.org/pipermail/rules-users/attachments/20100826/d694c41b/attachment-0001.html</a><br>

<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 26 Aug 2010 09:48:19 -0300<br>
From: Esteban Aliverti &lt;<a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>&gt;<br>
Subject: Re: [rules-users] Stuck Threads<br>
To: Rules Users List &lt;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
Message-ID:<br>
        &lt;AANLkTi=-<a href="mailto:nMM4pkKFbxTa_WWRqpPsFi9QbGN8iY_fSsxC@mail.gmail.com">nMM4pkKFbxTa_WWRqpPsFi9QbGN8iY_fSsxC@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
StatefulSessions are not thread safe.<br>
<br>
El ago 26, 2010 9:23 a.m., &quot;Burak Aydin&quot; &lt;<a href="mailto:burak.aydin@obss.com.tr">burak.aydin@obss.com.tr</a>&gt; escribi?:<br>
<br>
Hello,<br>
<br>
While trying to open stateful session in a 32 core machine and 35 threads,<br>
all of the threads hangs. Below is the stack trace. ChainedProperties class<br>
seems to be thread-unsafe??<br>
<br>
gridgain-#13%null%&quot; - Thread t@64<br>
<br>
   java.lang.Thread.State: RUNNABLE<br>
<br>
        at<br>
sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:806)<br>
<br>
        at<br>
sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:765)<br>
<br>
        at<br>
sun.misc.URLClassPath$JarLoader.findResource(URLClassPath.java:735)<br>
<br>
        at sun.misc.URLClassPath$1.next(URLClassPath.java:196)<br>
<br>
        at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:206)<br>
<br>
        at java.net.URLClassLoader$3$1.run(URLClassLoader.java:416)<br>
<br>
        at java.security.AccessController.doPrivileged(Native Method)<br>
<br>
        at java.net.URLClassLoader$3.next(URLClassLoader.java:413)<br>
<br>
        at<br>
java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:438)<br>
<br>
        at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:27)<br>
<br>
        at<br>
sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:36)<br>
<br>
        at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:27)<br>
<br>
        at<br>
sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:36)<br>
<br>
        at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:27)<br>
<br>
        at<br>
sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:36)<br>
<br>
        at<br>
org.drools.util.ChainedProperties.loadProperties(ChainedProperties.java:232)<br>
<br>
        at org.drools.util.ChainedProperties.(ChainedProperties.java:112)<br>
<br>
        at org.drools.util.ChainedProperties.(ChainedProperties.java:41)<br>
<br>
        at org.drools.util.ChainedProperties.(ChainedProperties.java:35)<br>
<br>
        at<br>
org.drools.SessionConfiguration.init(SessionConfiguration.java:131)<br>
<br>
        at org.drools.SessionConfiguration.(SessionConfiguration.java:112)<br>
<br>
        at<br>
org.drools.impl.KnowledgeBaseImpl.newStatefulKnowledgeSession(KnowledgeBaseImpl.java:134)<br>
<br>
        at texan.qset.service.QsetService.executeQset(QsetService.java:72)<br>
<br>
        at texan.qset.service.QsetService.executeQset(QsetService.java:34)<br>
<br>
        at<br>
texan.crop.service.ProductPostingService.processQSet(ProductPostingService.java:600)<br>
<br>
        at<br>
texan.crop.service.ProductPostingService.processQSets(ProductPostingService.java:582)<br>
<br>
        at<br>
texan.crop.service.ProductPostingService.createOrUpdateProduct(ProductPostingService.java:562)<br>
<br>
        at<br>
texan.crop.service.ProductPostingService.postingProcess(ProductPostingService.java:181)<br>
<br>
        at<br>
texan.crop.service.ProductPostingService.productPostingProcess_aroundBody0(ProductPostingService.java:85)<br>
<br>
        at<br>
texan.crop.service.ProductPostingService$AjcClosure1.run(ProductPostingService.java:1)<br>
<br>
        at org.aspectj.runtime.reflect.JoinPointImpl.proceed(Unknown Source)<br>
<br>
        at<br>
falez.runtime.aop.FalezTransactionalAspect$4.proceed(FalezTransactionalAspect.java:176)<br>
<br>
        at<br>
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)<br>
<br>
        at<br>
falez.runtime.aop.FalezTransactionalAspect.advice(FalezTransactionalAspect.java:215)<br>
<br>
        at<br>
falez.runtime.aop.TexanTransactionalAspect.ajc$inlineAccessMethod$falez_runtime_aop_TexanTransactionalAspect$falez_runtime_aop_FalezTransactionalAspect$advice(TexanTransactionalAspect.java:1)<br>
<br>
        at<br>
falez.runtime.aop.TexanTransactionalAspect.around(TexanTransactionalAspect.java:26)<br>
<br>
        at<br>
texan.crop.service.ProductPostingService.productPostingProcess(ProductPostingService.java:80)<br>
<br>
        at<br>
texan.crop.batch.grid.ProductPostingBatch.doCifProcess(ProductPostingBatch.java:45)<br>
<br>
        - locked texan.crop.batch.grid.ProductPostingBatch@@10880<br>
<br>
        at<br>
texan.crop.batch.grid.ProductPostingBatch.doProcess(ProductPostingBatch.java:37)<br>
<br>
        at<br>
falez.runtime.batch.AbstractBatchOperation.doProcess(AbstractBatchOperation.java:209)<br>
<br>
        at<br>
texan.crop.batch.grid.ProductPostingBatch.doProcess_aroundBody0(ProductPostingBatch.java:29)<br>
<br>
        at<br>
texan.crop.batch.grid.ProductPostingBatch$AjcClosure1.run(ProductPostingBatch.java:1)<br>
<br>
        at org.aspectj.runtime.reflect.JoinPointImpl.proceed(Unknown Source)<br>
<br>
        at<br>
falez.runtime.aop.FalezTransactionalAspect$4.proceed(FalezTransactionalAspect.java:176)<br>
<br>
        at<br>
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)<br>
<br>
        at<br>
falez.runtime.aop.FalezTransactionalAspect.advice(FalezTransactionalAspect.java:215)<br>
<br>
        at<br>
falez.runtime.aop.TexanTransactionalAspect.ajc$inlineAccessMethod$falez_runtime_aop_TexanTransactionalAspect$falez_runtime_aop_FalezTransactionalAspect$advice(TexanTransactionalAspect.java:1)<br>
<br>
        at<br>
falez.runtime.aop.TexanTransactionalAspect.around(TexanTransactionalAspect.java:26)<br>
<br>
        at<br>
texan.crop.batch.grid.ProductPostingBatch.doProcess(ProductPostingBatch.java:28)<br>
<br>
        at<br>
falez.runtime.batch.AbstractBatchOperation.process(AbstractBatchOperation.java:76)<br>
<br>
        at<br>
falez.runtime.batch.BatchProcessingTask$BatchProcessingJob.doExecute(BatchProcessingTask.java:89)<br>
<br>
        at<br>
falez.runtime.batch.BatchProcessingTask$BatchProcessingJob.execute(BatchProcessingTask.java:76)<br>
<br>
        at<br>
falez.runtime.batch.BatchProcessingTask$BatchProcessingJob.execute(BatchProcessingTask.java:1)<br>
<br>
        at<br>
org.gridgain.grid.kernal.processors.job.GridJobWorker.body(GridJobWorker.java:406)<br>
<br>
        at<br>
org.gridgain.grid.util.runnable.GridRunnable$1.run(GridRunnable.java:142)<br>
<br>
        at<br>
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)<br>
<br>
        at<br>
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)<br>
<br>
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)<br>
<br>
        at<br>
org.gridgain.grid.util.runnable.GridRunnable.run(GridRunnable.java:194)<br>
<br>
        at<br>
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)<br>
<br>
        at<br>
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)<br>
<br>
        at java.lang.Thread.run(Thread.java:619)<br>
<br>
--<br>
Burak AYDIN<br>
Senior Software Engineer<br>
OBSS<br>
-------------------------------------<br>
9433 @YKB<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.jboss.org/pipermail/rules-users/attachments/20100826/da594504/attachment.html" target="_blank">http://lists.jboss.org/pipermail/rules-users/attachments/20100826/da594504/attachment.html</a><br>

<br>
------------------------------<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
End of rules-users Digest, Vol 45, Issue 121<br>
********************************************<br>
</blockquote></div><br><br clear="all"><br>-- <br>Burak AYDIN<br>Senior Software Engineer<br>OBSS<br>-------------------------------------<br>9433 @YKB<br>