Hi!
> Rickard Oberg wrote:
>
> > I'm afraid you misunderstood me. The deserialization process *replaces*
old
> > ctx's but they need to be in there in the first place so that there is
> > something to replace. The above won't work.
> >
> > Exactly why can't we serialize the ctx? As far as I can recall there is
no
> > state in it.
>
> The context (StatefulSessionContextImpl) is an inner class of
> StatefulSessionEnterpriseContext. So we can't call Field.get(), because
> the constructor is not available.
>
> And then, is it possible to serialize an instance of an inner class
> without serializing the instance of the outer class? (in this case the
> outer instance has much state in it)
Can we make it a static inner class then? That way there is no connection
> And what about changing my fix with
>
>
if(!SessionContext.class.isAssignableFrom(((Field)fields.get(i)).getType()))
> out.writeObject(((Field)fields.get(i)).get(ctx.getInstance()));
> else
> out.writeObject(null or maybe typed dummy);
Still flawed since ctx's can be within other fields (i.e. it is allowed to
serialize a vector that contains a ctx).
Again, forget the above fix completely since it is wrong from the beginning.
/Rickard