[rules-users] Drools session reuse question

arrehman arrehman73 at yahoo.com
Sun Oct 30 19:18:58 EDT 2011


Is creation of StatefulKnowledgeSession expensive? Is there a guideline or
best practice regarding this? 

Currently I am creating a new session /kbase.newStatefulKnowledgeSession()/
each time I want to call /session.fireAllRules()/. I do this for each of the
200,000 data records that I have. So it creates and destroys 200 drools
sessions (monitored via drools JMX bean)

I was trying to reuse the same drools session for each of those 200,000 data
records to see if it improves the performance (don't know if this is frowned
upon or recommended). However this was failing my rules left and right, not
sure why, possibly because I am not cleaning up the session cleanly. I have
been calling /session.dispose() /after every /fireAllRules() /though.

Any thoughts?

Thanks,
Abdul


--
View this message in context: http://drools.46999.n3.nabble.com/Drools-session-reuse-question-tp3466635p3466635.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list