> I have never tried serializing an object by explicitly calling readObject()
> and writeObject() on a serializable. Does that work?
Yes. During serialization these methods will get called to allow a class to
control its own serialization process (mostly for transient fields). I am
using them when serializable classes (bean or otherwise) have references to
beans. These classes hold their bean references in transient fields and
during serialization I write out either the handle, or now the home/pk pair.
> Is there a reason why you were using the EJB handle? I'm pretty sure it's
> no problem just to keep a reference to an entity bean, which will be
> serialized by the container when your SSB is passivated. If you needed a
> handle (which I beleive is mostely used if you need to store a long-term
> reference outside the app server,) this should also be serialized for you
> automatically.
> Maybe I'm not understanding what you're trying to do?
Okay. I use a utility class to wrap all access to entity beans, this is used
to localize lookup and exception handling. Any class (bean or otherwise)
that wants access to an EB uses its utility class.
So my SFSB gets an instance of the utility class and the utility class holds
the reference to the EB in a transient variable.
As well the SFSB may pass to the remote client a copy of the utility class so
that it can directly access some EB services independent of its 'session'.
I read somewhere (can't recall just now) that I was to use the handle, so
that was what I was doing. But after resolving the passivation/activation
yesterday, I have changed all my wrapper classes to use home/pk.
I wish I better understood what was happening with these various types of
references so I could know precisely which type to use under which
circumstances. I am pretty confused. And you have suggested that for in
server references (those held directly or indirectly by beans) that I
shouln't have to do anything, the server will take care of it --frustrated
sigh.
And what if the reference was from a servlet/jsp when the web container is
running in the save VM. Would it still be taken care of?
Would you happen to know a reference/tutorial that distinguishes and
contrasts each of the reference types and explains when and how to use them
apppropriately?
Thanks again
Mike.
===================
Mike Finn
Tactical Executive Systems
[EMAIL PROTECTED]
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user