]
Mario Fusco resolved DROOLS-2892.
---------------------------------
Resolution: Done
Fixed by
Session reset doesn't clear path memory
---------------------------------------
Key: DROOLS-2892
URL:
https://issues.jboss.org/browse/DROOLS-2892
Project: Drools
Issue Type: Bug
Reporter: Christian Liebhardt
Assignee: Mario Fusco
As discussed in
https://groups.google.com/forum/#!topic/drools-usage/V8ypP1o5SwM :
In order to reduce memory allocations we are calling
_StatefulKnowledgeSessionImpl.reset()_ to bring a disposed session back into life. From
our understanding this is the same method which the Drools session cache would use. During
our tests we found that some of our rules don't trigger if we use this approach. We
also found that the reset method leaves _PathMemory_ instances behind in the memory. As
soon as we cleared the memory explicitly by calling _session.getNodeMemories().clear()_
after every _session.reset()_ the rules fired again as usual. So we are wondering if the
current implementation of _session.reset()_ is incomplete.
We are aware that _session.reset()_ is an internal method. However this issue should also
affect the session cache feature of Drools. At the same time it would be nice to have a
public interface to _session.reset()_ since in our application reusing a session is
beneficial but we don't need the session cache as we can easily remember the last
session which we used for processing and it seems more straightforward to just bring that
one back to life instead of storing and retrieving it from a cache.