[rules-users] Removing facts from statefulknowledgeSession's memory

Wolfgang Laun wolfgang.laun at gmail.com
Wed Nov 10 08:55:11 EST 2010


In contrast to what is written in the Fusion manual, section
2.8., Memory Management for Events, an explicit expiry time
set in the declare overrules any implicit expirations calculated
from an event type's usage in rules.

To set an unconditional expiry of 5 minutes, you just use, e.g.,
declare MyEvent
   @role( event )
   @expires( 5m )
end

You may also rely on an implicit expiry time, but note that
there may be rules that produce an infinite expiry time. In
an application such as you describe, an explicit expiry is
certainly preferable.

-W


On 10 November 2010 13:45, Ayush <ayush.vatsyayan at alcatel-lucent.com> wrote:
>
> Hi,
>
> In my drools implementation I'm inserting all my facts into working memory
> and for every fact received I'm also inserting events into notification
> stream.
> Now the StatefulKnowledgeSession I'm using is static and it is neither
> initialized nor disposed after being initialized for first time. My
> application will run for months without restarting and so the same session
> will be used without being reinitialized or disposed.
>
> Do I have to retract events explicitly or will it handled by drools
> internally? If not then how can I retract them say after 5 minutes?
>
> Also I'm using sliding window and I've not explicitly declared expiry time,
> for events, in my drl file. Should I define it or will drools remove them
> after the maximum sliding window time defined in rules?
> --
> View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Removing-facts-from-statefulknowledgeSession-s-memory-tp1875795p1875795.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list