What is difference between stateless and stateful knowledge sessions.I read some documents both are maintained state.But when can i use stateless/stateful knowledge sessions.
Stateless: The facts/working memory is inserted to Knowledge base session before firing rules. These facts can be set by calling public methods on an object while executing rules and after setting these objects are returned back with changed values.
Any changes in the facts while executing rules, for example insert(xyz)
or modify(xyz)
, is not made aware to the rule engine.
Stateful: The facts/working memory is inserted to Knowledge base session before firing rules and after the rules are fired dispose() has to be called to avoid memory leaks.
Any changes in the facts while executing rules, for example insert(xyz)
or modify(xyz)
, is made aware to the rule engine.