[Mono-dev] Patch for System.Runtime.Remoting.ServerIdentity

Svetlana Zholkovsky svetlanaz at mainsoft.com
Mon Oct 31 07:48:59 EST 2005


Hi all,

I found the following problem with the singleton remote object:
	When the lease of such object is expired, the object is
disconnected from the remoting infrastructure, 
      but it's ServerIdentity continue to hold reference to the server
sink chain, because the DisposeServerObject()
      method does not clear it and so, it will not be recreated for the
new attached singleton object.
      The server sink chain contains in it's last sink
(StackBuilderSink) reference to the old object, and
      all methods are executed on that old object, instead the new.
      It can be tested by trying to get the lease object associated with
the singleton. 
      After the lease is expired for the first time, the following
TestLease() method will fail 
      with NullReferenceException, because it is executed on the old
object and that object is already 
      disconnected from the identity, so
RemotingServices.GetLifetimeService will return null.
     
public class LifecycleTestObject : MarshalbyRefObject
{
	public void TestLease()
	{
			ILease lease =
(ILease)RemotingServices.GetLifetimeService(this);
			lease.Register(new MySponsor());
	}
}

Thanks,
Svetlana
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ServerIdentity.diff
Type: application/octet-stream
Size: 535 bytes
Desc: ServerIdentity.diff
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051031/f5a9baab/attachment.obj 


More information about the Mono-devel-list mailing list