2.5.5. StatefulSession

2.5.5. StatefulSession

StatefulSession
Figure 2.20. StatefulSession

The StatefulSession extends the WorkingMemory class. It simply adds async methods and a dispose() method. The ruleBase retains a reference to each StatefulSession is creates, so that it can update them when new rules are added, dispose() is needed to release the StatefulSession reference from the RuleBase, without it you can get memory leaks.

StatefulSession session = ruleBase.newStatefulSession();
Example 2.11. Createing a StatefulSession