[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Disposing CAO Remoting object from client

anat

10/12/2004 10:24:00 AM

Hi

i have an IDisposable CAO that has a lifetimeservice set to null.

if i call Dispose from client on that object, will the GC deallocates that
object, or because i set the lifetime to null the object will live forever
?.

is there a way to enforce object disposal on a CAO which has a lifetime set
to null if the answer to the first question is no ?

Thanks,
U & A


1 Answer

Sam Santiago

10/12/2004 2:13:00 PM

0

Calling Dispose on a CAO won't control its lifetime. It can release any
associated resources it may have explicitly though. If you truly want to
control a CAOs lifetime you will probably not have to use a unlimited
lifetime (return null) and define a sponsor object. Read this article for
details:

Managing the Lifetime of Remote .NET Objects with Leasing and Sponsorship
http://msdn.microsoft.com/msdnmag/issues/03/12/LeaseManager/de...

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"anat" <anat_hertzman@hotmail.com> wrote in message
news:OreR8WEsEHA.4008@TK2MSFTNGP14.phx.gbl...
> Hi
>
> i have an IDisposable CAO that has a lifetimeservice set to null.
>
> if i call Dispose from client on that object, will the GC deallocates that
> object, or because i set the lifetime to null the object will live forever
> ?.
>
> is there a way to enforce object disposal on a CAO which has a lifetime
set
> to null if the answer to the first question is no ?
>
> Thanks,
> U & A
>
>