Sunny
7/15/2004 2:24:00 PM
Hi,
the best way is to implement client side sponsors for your CAOs. That
way, if for some reason the client dies without proper releasing of the
object, the object will be freed.
Or you may override InitializeLifetimeService method in your CAO and set
the right timeouts.
Sunny
In article <uMKwo8laEHA.3508@TK2MSFTNGP09.phx.gbl>, bedlaz@tin.it
says...
> Hi,
> I''ve created a 3-tier application using .net remoting. In the server there
> is an 3-tier console that activates an object, the ''CampusDataAccessLoader''
> that is a SAO, and is a singleton,i.e., there is only one instance of it.
> The ''CampusDataAccessLoader'' is a kind of ''class factory'', i.e. it is used
> to create another object which is referenced by the clients as a transparent
> proxy
> Every client connects to the ''DataAccessLoader'' object, and obtains a
> ''DataAccess'' object through a method of the CampusDataAccessLoader, let''s
> say
>
> BinaryClientFormatterSinkProvider clientProvider new
> BinaryClientFormatterSinkProvider();
> IDictionary props = new Hashtable();
> props["port"]=8989;
> props["name"]= System.Guid.NewGuid.ToString();
> TcpChannel chan = new TcpChannel(props, clientProvider, null);
> ChannelServices.RegisterChannel(chan);
> CampusDataAccessLoader Loader = (CampusDataAccessLoader)
> Activator.GetObject(
>
> typeof(CampusDataAccessLoader),"tcp://...remoteserver:8989/CampusDataAccessL
> oader)
> DataAccess DA = Loader.GetDataAccess(myuserid, mypassword) //---->DA is the
> object used in the client to access the DataBase!
>
> Well, everything is working well, but if the client user does not use
> DataAccess'' methods for some minutes, it seems that the remote DataAcces
> object is disconnected... I suppose it''s a time out problem.
>
> I''ve tried adding
> <lifetime
>
> leaseTime="60M"
>
> sponsorshpTimeOut="60M"
>
> renewOnCallTime = "60M"
>
> leaseManagerPollTime="10M"
>
> />
>
> to the server config (attached), but it has no effect....
> In the server machine I can query, through the CampusDataAccessLoader
> methods, all the object created (remotely) by the clients, and they are
> still alive!! It''s the client that has lost the connection with the
> DataAccess (DA) object!!
> Can some one explain me how to fix this problem?
>
>
> Many thanks in advance,
> Nino
>
>
>
>
>
> begin 666 CampusDataAccessLoader.exe.config
> M/&-O;F9I9W5R871I;VX^#0H@(" \<WES=&5M+G)U;G1I;64N<F5M;W1I;F<^
> M#0H@(" @(" \87!P;&EC871I;VX^#0H@(" @(" @(" \<V5R=FEC93X-"B @
> M(" @(" @(" @(#QW96QL:VYO=VX@#0H@(" @(" @(" @(" @("!M;V1E/2)3
> M:6YG;&5T;VXB( T*(" @(" @(" @(" @(" @=''EP93TB;65T86-A;7!U<VQI
> M8G)A<GDN0V%M<''5S1&%T84%C8V5S<TQO861E<BP@;65T86-A;7!U<VQI8G)A
> M<GDB( T*(" @(" @(" @(" @(" @;V)J96-T57)I/2)#86UP=7-$871A06-C
> M97-S3&]A9&5R+G)E;2(-"B @(" @(" @(" @("\^#0H@(" @(" @(" \+W-E
> M<G9I8V4^#0H@(" @(" @(" \8VAA;FYE;'',^#0H@(" @(" @(" @(" \8VAA
> M;FYE;"!R968](G1C<"(@<&]R=#TB.#DX.2(O/@T*(" @(" @(" @/"]C:&%N
> M;F5L<SX)(" @#0H)(" @/&QI9F5T:6UE( T*"0EL96%S951I;64](C8P32(-
> M"@D)<W!O;G-O<G-H<%1I;65/=70](C8P32(-"@D)<F5N97=/;D-A;&Q4:6UE
> M(#T@(C8P32(-"@D);&5A<V5-86YA9V5R4&]L;%1I;64](C$P32(-"@D@(" O
> M/@T*(" @(" @/"]A<''!L:6-A=&EO;CX-"B @(#PO<WES=&5M+G)U;G1I;64N
> ;<F5M;W1I;F<^#0H\+V-O;F9I9W5R871I;VX^
> `
> end
>
>