Drools and jBPM are being executed in the same thread, in your set up mina is not. Is that what are you pointing out?<div>Did you really need to have mina in a separate JVM or you can use the Local Implementation?</div><div>

Cheers<br><br><div class="gmail_quote">On Fri, Jun 22, 2012 at 10:00 AM, Alberto R. Galdo <span dir="ltr">&lt;<a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>I see your point, but IMHO that doesn&#39;t mean that in certain circumstances, when the process is being executed in a thread that it is no the same thread as the one in which drools is executing leads to a situation in which the persistence mechanisms are not enough to allow a fault tolerant JBPM for long-time running processes.<br>



<br>As mentioned, there is at least one scenario, at least when mina is involved, where things are broken.<span class="HOEnZb"><font color="#888888"><br><br clear="all">Alberto R. Galdo<br><a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a></font></span><div class="HOEnZb">

<div class="h5"><br>


<br><br><div class="gmail_quote">On Fri, Jun 22, 2012 at 2:50 PM, Mauricio Salatino <span dir="ltr">&lt;<a href="mailto:salaboy@gmail.com" target="_blank">salaboy@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



I think that you are mixing things up. <div>Did you take a look at the CommandBasedStatefulKnowledgeSession?<br>Every command that represent an operation against the knowledge session is being executed inside a transaction, for both rules and processes. As soon as a safe point is found (for both processes and rules) the persistence mechanism commits the transaction.</div>





<div><br></div><div><div>&quot;In fact, this will never dissapear unless some communication mechanism between Drools &amp; JBPM is developed to allow the processes to be executed  inside Drools Reteoo thread.&quot;<br>

</div>Take a look at the class that I mention and then try to explain me what you mean with the previous sentence.</div>

<div><br></div><div>Cheers<div><div><br><br><div class="gmail_quote">On Fri, Jun 22, 2012 at 9:45 AM, Alberto R. Galdo <span dir="ltr">&lt;<a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a>&gt;</span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>No, I didn&#39;t. I need to be able to deploy the human task server and my knowledge session in separate JVM&#39;s. And Mina is on my way.<br>





<br>The fact that I am able to do things in some other way doesn&#39;t make this very problem dissapear ... :(. In fact, this will never dissapear unless some communication mechanism between Drools &amp; JBPM is developed to allow the processes to be executed  inside Drools Reteoo thread.<br>







<br>Isn&#39;t that so?<span><font color="#888888"><br><br><br clear="all">Alberto R. Galdo<br><a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a></font></span><div><div>

<br>
<br><br><div class="gmail_quote">On Fri, Jun 22, 2012 at 2:17 PM, Mauricio Salatino <span dir="ltr">&lt;<a href="mailto:salaboy@gmail.com" target="_blank">salaboy@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







Both persistence mechanisms are already unified.<div>the jBPM-persistence module extends the Drools one adding the relevant entities by the processes. </div><div><br></div><div>You can be having problems with the Mina Server, did you try the local configuration? The Mina Server was designed to run in a different JVM than the session, as a standalone component, if you are running it in the same JVM that can be causing some transactional problems as you mention. If you need to run it in the same JVM you can use the local configuration, did you try that?</div>









<div>Cheers<br><br><div class="gmail_quote"><div><div>On Fri, Jun 22, 2012 at 8:31 AM, Alberto R. Galdo <span dir="ltr">&lt;<a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>

Hi,<br><br>   I&#39;m opening this thread in the aim of generating a debate about the approach to session persistence in Drools and JBPM for BPMN processes which by definition are able to generate asynchronous human tasks. <br>











<br>   IMHO the current approach needs to be refactored in favor of joining the management of the different Drools and JBPM entities in an unique manager.<br><br>   The current implementation offers two managers one in Drools, one in JBPM. Each of this managers are wrappers of a shared JPA EntityManager context and manage their own entities. <br>











 <br>   When the integration of JBPM into Drools was done ( leaving behind drools flow ), the approach seemed to be to make the entities in JBPM ( workitems, processinstance and so on ) look like the entities in Drools. As a result, the implementation of those entities in JBPM now implement the interfaces of the same entities in Drools. That looked like a good approach, but the experience, at least mine, seems to reveal it as not that good.<br>











<br>   In my opinion, the first problem with that approach is that Drools, the reteoo algorithm, runs in a single-threaded environment. Drools persistence was designed having this in mind, so for the code in Drools, there&#39;s no doubt that when in a persistent enviroment, the transaction, if any, will be bound to the same thread as the one in which the reteoo algorithm is executed. That leads to situations where whenever a class in JBPM calls drools in a JBPM&#39;s thread ( the mina handler thread, a NIO one for instance ), Drools thinks that is being executed in it&#39;s own thread ( where things are expected, as the JTA transaction bound for example ) and clearly, in some situations it is not the case. Then Drools expects to find certain resources and certain environment which are not always there. Leading to failure.<br>











<br>   As Drools now is a dependency for JBPM through the Knowledge-API, I think that the management of the persistence for Drools and JBPM should be merged in one that makes no assumptions and manages the needs for persistence in a coherent way for both products.<br>











<br>   What do you think?<br><br><br>&quot;There can be only one&quot; -&gt; <a href="http://en.wikipedia.org/wiki/Highlander_%28film%29" target="_blank">http://en.wikipedia.org/wiki/Highlander_%28film%29</a> <br><span><font color="#888888"><br>









<br clear="all">Alberto R. Galdo<br>

<a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a><br><br>
</font></span><br></div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div> - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>









 - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div><br>
</font></span></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div><br>
</div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div><br><br clear="all"><div><br></div>-- <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div> - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>





 - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div><br>
</div></div></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div><br>
</div></div><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></blockquote></div><br><br clear="all"><div><br></div>-- <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div> - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>

 - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div><br>
</div>