Groups | Blog | Home
all groups > dotnet remoting > october 2006 >

dotnet remoting : Client Activated objects from a asp.net client


siddharthkhare NO[at]SPAM hotmail.com
10/18/2006 8:40:41 PM
Hi All,
In my current projects i have business obejcts that are running on a
remote server and Presentation (ASP.net) is accesing it using .net
remoting(IIS + TCP + BinaryFormatter).

Sample objects are ..users object that contains a collection of user
objects.

ASP.net request will instantiate the users object
now when i create users object it has to stay in memory till that
asp.net request is being processed.

so i can not use server activated object .I don't want to use
singleton.

so only solution i see is client activated - single call object.

1)Are there any known architectural issues in using client activated
object from a web client application..like asp.net

2)I can set the life time of the object to some reasonable time
depending on how much time the web request will take on the server.

when server asks clinet to renew lease ..how does it identify the
client..

in a web application all request to the remote server are comming from
the same clinet (web server)...would remoting infrastructure
automatically make the request to right thread on the server..

Any other problems that may occur because of this architecture?
Thanks
Sidd
siddharthkhare NO[at]SPAM hotmail.com
10/19/2006 12:39:32 PM
It is asp.net ode behind page which is making the request to remote
object.


ASP.net will have mutple threads running to serve mutiple request from
differents clinets(Browser).

Request to the remote server for objects could be made concurrently
from different asp.net threads.

when remote server asks clients to renew the lease whould it go to
right thread.

I think it would but just wanted to confirm.

it is NOT a thick client application where clinet would be different
physical machine.

In my case it same asp.net process/same machine (multiple thread ) that
is making call.


So in short will remoting infrastructure identify the thread that made
the call and ask that specfic tharad only to renew the lease.

Just wanted to confirm it.

2)Also won't i end up having objects longer in memory than they would
be if i was to lets say just use them locally.
because this check of lease renewal will only happen at certain
interval object will be in memory of remote server slightly longer that
required.
Would this cause any perormance issues on a high stress environment?

only counter argument i can think for this is that even when we
deallocate a object garbage collector does not collect it immediately
so if remoting adds few more second/millisecond to it it may be okay..

but again need to see what others think about it.

Thanks
Sidd
Günter Prossliner
10/19/2006 2:36:09 PM
Hi!

[quoted text, click to view]

Why don't you use the SingleCall Server-Activated Objects?

[quoted text, click to view]

None I am aware of.

[quoted text, click to view]

If you use Client-Activated Objects the Lifetime-Management is more
complicated compared to Server-Activated Objects. The default Lifetime -
Implementation returns a ILease Object with configured Timespans when an
Object will be released.


If you want the Lifetime of an Object to be controlled by the Client itself,
you have to implementent a Sponsor (ISponsor) that runs on the clientside.


http://msdn.microsoft.com/msdnmag/issues/03/12/LeaseManager/default.aspx
http://www.thinktecture.com/Resources/RemotingFAQ/Lifetime.html

http://www.google.com/search?q=%2enet+remoting+lifetime


[quoted text, click to view]

The ObjRef is serialized to the server.

[quoted text, click to view]

What do you meen with "the right thread"? Remoting uses the ThreadPool.




GP

AddThis Social Bookmark Button