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
I want to quote the drools documentation here which cleared my mind.
"StatelessKnowledgeSession provides a convenience API, wrapping StatefulKnowledgeSession. It avoids the need to call dispose(). Stateless sessions do not support iterative invocations, the act of calling execute(...) is a single shot method that will internally instantiate a StatefulKnowledgeSession, add all the user data and execute user commands, call fireAllRules, and then call dispose()."
So basically, stateless session is a stateful session used one time.
This then imply that stateless session can also do inference, unlike many documents and some answers here said! This should only depend on the "then" part of the rule, whether you use "modify" or not.
While I have not verify this myself, this post seems support my reasoning.
https://groups.google.com/forum/#!topic/drools-usage/qYbqiS1ht4g