Hi all,<br>
&nbsp;&nbsp;I am facing a problem with  persisted stateful knowledge session, please help me. My rule is listed as below:<p>
package com.sample<br>
import com.sample.Event;<br>
import java.util.List;<br><br>

declare Event<br>
&nbsp;&nbsp;@role(event)<br>
end<br><br>

rule "test"<br>
&nbsp;&nbsp;when<br>
&nbsp;&nbsp;&nbsp;&nbsp;$list : List() from collect(Event() over window: length(2))<br>
&nbsp;&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("----print out in rule, size of the list collected from window is:" + $list.size());<br>
end</p>
&nbsp;&nbsp;The problem is,<br> 
<ul>
<li>when use a normal stateful session(created by the calling kbase.newStatefulKnowledgeSession()), <b>when a third fact inserted, the session working memory only retains list of 2, as expected.</b>
</li>
<li>when use a persisted stateful session(created by the calling JPAKnowledgeService.newStatefulKnowledgeSession()), insert 2 facts first. Then restore this session by JPAKnowledgeService.loadStatefulKnowledgeSession(), and <b>insert a third fact, the session working memory grows to list of 3?</b> 
</li>
</ul>
&nbsp;&nbsp;By the way, I am using version 5.2.0.Final. And after I upgrade to version 5.4.0.Final, the test result of persisted session becomes to normal.<b>The attachment is my test program and you can repeat it.</b><br>
 &nbsp;&nbsp;I want to ask you if there is something missing that I need to do in 5.2.0.Final?<br>
 &nbsp;&nbsp;Thank you in advance, any help will be appreciated. <a href="http://drools.46999.n3.nabble.com/file/n4019766/drools-session-persis-demo.zip" target="_top" rel="nofollow" link="external">drools-session-persis-demo.zip</a>

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://drools.46999.n3.nabble.com/problem-with-pesisted-stateful-knowledge-session-and-Length-Sliding-Window-tp4019766.html">problem with pesisted stateful knowledge session and Length Sliding Window</a><br/>
Sent from the <a href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html">Drools: User forum mailing list archive</a> at Nabble.com.<br/>