2011/4/20 Esteban Aliverti <span dir="ltr">&lt;<a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
@Wolfgang: if you are using <span style="border-collapse: collapse; color: rgb(0, 0, 255); font-family: Consolas,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,Courier,monospace; font-size: 11px; line-height: 14px;">drools.agent.newInstance=true </span>(the default configuration), then whenever a change-set is applied, either because you explicitly force the agent to  do so, or because a monitored resource changes, the kbase inside the agent is thrown away an a new kbase is created. So you need to get the kbase from the agent and retrieve a fresh session from it.<div>


You can confirm this behavior in this set of tests: <span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;"><a href="https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentIncrementalChangeSetTest.java" style="color: rgb(7, 77, 143);" target="_blank">https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentIncrementalChangeSetTest.java</a>  <br>


</span><div>But, if you are using <span style="border-collapse: collapse; color: rgb(0, 0, 255); font-family: Consolas,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,Courier,monospace; font-size: 11px; line-height: 14px;">drools.agent.newInstance=false </span>the internal kbase (and each stateful session you got from it) is refreshed when a change-set is applied.<br>


<br></div></div></blockquote><div><br>Would you please point me to the doc where it says &quot;and each stateful session ... is refreshed&quot;?<br><br>If true, this were an extremely risky operation. Consider a stateful session whizzing along and - smack! - rules change right in the middle of a sequence of firings. Shudder.<br>
<br>-W<br><br><br></div></div><br>