Sim IJskes - QCG wrote:
Peter Firmstone wrote:
Note that when you export your service it's proxy is stored in
Marshalled form until the client discovers it, while in Marshalled form
Eh, that isn't exactly true is it? After export, you get a Proxy with
a reference to a BasicInvocationHandler with a reference to a
BasicObjectEndpoint with a reference to a ImplContainer with a
reference to your service.
As long as you keep the reference to the exported service, the service
is 'strongly reachable' from the exported service.
The problem starts when you marshall it in
BasicInvocationDispatcher.marshalReturn(), and the reply has enough
latency to arive 'late' at the client side.
In this window the service becomes 'weakly reachable' and if the GC
kicks in before DgcServer.dirty the object gets finalized.
Keep a strong reference, to the service (not the proxy), long enough to
prevent it from being garbage collected. Sorry, don't know enough about
your implementation to make any other suggestions.
- Peter.