As I understand if you still use this session than should not call dispose(). This method
only called when this session not used anymore.
After each fireAllRules() you can call retract to release memory resource.
Best Regards,
Tony(Baiyuan, Tang)
Insigma Hengtian Software Ltd.
(C) +86-13858148802
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of arrehman
Sent: 2011年10月31日 7:19
To: rules-users(a)lists.jboss.org
Subject: [rules-users] Drools session reuse question
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-tp3466635...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users