I think Nik Joshi wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi all,
> 
> I posted this question a while ago without any code, and I got some replies
> which I tried, but to no avail.  So I've coded a simplified version of my
> problem to demonstrate.  I don't know if I can send attachments to this
> list, so I guess I'll have to put the code inline.  Basically, I have a java
> server and client where the server has a Rete object running a JESS batch
> file.   The JESS code periodically calls Userfunctions which, in turn,
> serialize the Fact data and send it to the client.   The problem is that the
> data in the facts does not get sent over properly.   When I de-serialize the
> data on the client end, some of the slot data in the facts is
> missing.

Ah, OK, thanks for the example -- it reveals the true problem. Nothing
to do with Jess, everything to do with Java serialization.

When you write an object to an ObjectOutputStream the first time using
writeObject, the OOS "remembers" the object by storing a reference to
it. If you write it a second time, the data is *not* written
again. Instead, a token representing that reference is
written. This is what lets the OOS send a graph of objects without
worrying about cycles.

Therefore, once you've sent an object through an OOS, you can't send a
version of that same object with different member variables using
writeObject. Instead, you can use the writeUnshared method, which
sends an object as if it had never been sent before. You need to
rewrite your program using writeUnshared.





---------------------------------------------------------
Ernest Friedman-Hill  
Science and Engineering PSEs        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]
--------------------------------------------------------------------

Reply via email to