[rules-users] Why StatelessKnowledgeSession Instantiates a New StatefulKnowledgeSession on Each execute()?

hyjshanghai hyjshanghai at gmail.com
Thu Jan 27 03:45:22 EST 2011


According to Section 3.3.7 "StatelessKnowledgeSession" of 
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch03.html#d0e1956
the Drools document , "the act of calling execute() is a single-shot method
that will internally instantiate a StatefulKnowledgeSession".

Why StatelessKnowledgeSession instantiates a new statefulKnowledgeSession
object on Each execute()?

Instead, can it be implemented as inserting the fact into an existing empty
statefulKnowledgeSession, and retract the fact after
statefulKnowledgeSession.fireAllRules()?

I think the current implementation will cause StatelessKnowledgeSession  to
be slower than statefulKnowledgeSession, as opposed to "common sense" that
the former is less complex and should be faster. Any performance benchmark
on Stateless v.s. Stateful Sessions?
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Why-StatelessKnowledgeSession-Instantiates-a-New-StatefulKnowledgeSession-on-Each-execute-tp2360846p2360846.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list