I am using a pool of Rete objects in my application, i've just discovered and
issue where the my cleanup function seem to intermittently 'miss' a few
definstances.  Here's the Java code:
--
public void passivateObject(Object object) throws Exception {
        // undef all the java stuff
        logger.debug("Passivating rete engine, removing all definstances and
resetting");
        Rete engine = (Rete)object;
        Iterator i = engine.listDefinstances();
        while (i.hasNext())
        {
            Object instance = i.next();
            logger.debug("Instance Type: " + instance.getClass().getName());
            engine.undefinstance(instance);
        }
        ((Rete)object).reset();
        super.passivateObject(object);
    }
--
With (watch all), I can see the instance facts being removed from working
memory.  However, for some reason sometimes the Iterator does not seem to get
all of them.   When the reset is called, I see the initial fact get asserted
along with the 'missed' definstances.  There doesn't seem to be much rhyme or
reason with this issue, it happens from time to time but I can't seem to nail
down why.

Is Rete.listDefinstances() a reliable way to get all of my definstance facts ?

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to