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)


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

Sebastien


> 
> (sorry if you've discussed this already, I have missed that in that case)
> 
> /Rickard

Reply via email to