Hmm, this should not be the case but I will investigate further. This is in a
webapp where a single thread takes the user input, grabs a Rete from a pool,
stuffs in definstances, does a Rete.run(), then returns the Rete to the pool
where passivateObject gets called.
I'm doing single user testing in this case so even if the pool's misbehaving
somehow there should not be any competing requests. I will do some more
digging.
Thanks
On Wed, 1 Mar 2006 07:25:18 -0800 (PST), ejfried wrote
> The listDefinstance() method iterates over a snapshot of working
> memory at the time it is called, so that changes from other threads
> (or from the same thread) don't break the iteration. Perhaps the
> object is still "live" and it's either running, or other threads are
> adding new definstances, while passivateObject is running?
>
> I think erich.oliphant wrote:
> [Charset iso-8859-1 unsupported, filtering to ASCII...]
> > 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]
> > --------------------------------------------------------------------
> >
>
> ---------------------------------------------------------
> Ernest Friedman-Hill
> Advanced Software Research Phone: (925) 294-2154
> Sandia National Labs FAX: (925) 294-2234
> PO Box 969, MS 9012 [EMAIL PROTECTED]
> Livermore, CA 94550 http://herzberg.ca.sandia.gov
>
> --------------------------------------------------------------------
> 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]
> --------------------------------------------------------------------
--------------------------------------------------------------------
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]
--------------------------------------------------------------------