Well, although I did say that Alan was probably right that the
undefinstanced object was being held in a stale activation, I didn't
really suggest that calling "run" after calling undefinstance was the
solution -- that's a pretty nasty solution, in any case. What I did
for the next release (which I will send out today or tomorrow) is to
put a writeObject() method into HeapPriorityQueue, which actually
holds the agenda; this method "cleans" the agenda of any stale
activations before writing it out.

Now, I think there's a typo in your message below, as I don't
understand what you mean by "The max run is not being hit". Calling
run() here -should- clear the agenda and you shouldn't see the
serialization problem. In any event, I wrote a test case to try to
simulate what you described and found that I did indeed get the error,
and it was fixed by either calling run() or by the patch I described
above. So if you're still seeing a NotSerializableException, you might
need to check around for other referenes under you control; for
instance, do any of your other definstances refer to the
undefinstanced object? Is it held in the store/fetch table? Does one
of your Userfunctions have a reference to it?

I think James Gallogly wrote:
> Thanks for the rapid response, I am not completely convinced that these two
> problems are exactly the same. As I understand the detailed problem that
> Alan sent simply calling run after the retract should clear the agenda
> appropriately. Below is the code that causes the problem:
> 
>                          Rete r = GMain.instance().getEngine()
>                       //retract fact of unserializable object
>                     r.undefinstance(Federate.instance().getFedTime());
>                     //actually do this (beware other rules may fire as well)
>                     r.run();
> 
>                       //Serialize the Rete Engine
>                     SaveRestoreHelper.writeObject(r);
> 
> The max run is not being hit during this process, (at least in my test
> case). Its likely I just don't completely understand the problem Alan
> described or it might be a mixture of two issues. Any help/thoughts are much
> appreciated.
> 
> Thanks,
> Jim
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, July 18, 2002 8:11 PM
> To: [EMAIL PROTECTED]
> Subject: Re: JESS: retracted facts seem to hang around
> 
> 
> 
> I think James Gallogly wrote:
> >
> > My goal is to serialize the Rete. I am definstanceing a Fact based off of
> a
> > non-serializble object, doing a bunch of stuff, then undefinstancing the
> > non-serializble objects Fact just before Serializing the Rete. I get an
> > exception thrown saying it was unable to Serialize the non-serializable
> > object. This implies that somehow a reference to this retracted fact is
> > hanging around in the Rete and is attempting to be serialized.
> >
> 
> Thanks for the report; see below:
> 
> And I also think Alan Moore wrote:
> > I don't know if there is a problem beyond what is described in
> > Ernest's earlier post but this should clear some things up for you (I
> > am including the post here since I couldn't find a link to it in the
> > archives... go figure):
> 
> Good call Alan; this is almost certainly the cause of Mr. Gallogly's
> problem. I should be able to fix this for 6.1a3, which shouldn't be
> too far in the future. One way to fix it without disturbing anything
> at runtime would be to add an Agenda.writeObject() which removed
> any deactivated Activation objects.
> 
> ---------------------------------------------------------
> Ernest Friedman-Hill
> Distributed Systems Research        Phone: (925) 294-2154
> Sandia National Labs                FAX:   (925) 294-2234
> Org. 8920, MS 9012                  [EMAIL PROTECTED]
> PO Box 969                  http://herzberg.ca.sandia.gov
> Livermore, CA 94550
> 
> --------------------------------------------------------------------
> 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]
> --------------------------------------------------------------------
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

--------------------------------------------------------------------
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