Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / October 2006

Tip: Looking for answers? Try searching our database.

Client Activated objects from a asp.net client

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
siddharthkhare@hotmail.com - 19 Oct 2006 04:40 GMT
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
Günter Prossliner - 19 Oct 2006 13:36 GMT
Hi!

> 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.

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

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

None I am aware of.

> 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.

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

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

The ObjRef is serialized to the server.

> 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..

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

GP
siddharthkhare@hotmail.com - 19 Oct 2006 20:39 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.