469,287 Members | 2,666 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,287 developers. It's quick & easy.

Remoting Singleton v.s. SingleCall

I understand the difference between the two types (Singleton & SingleCall)
but what affect does this have if the Remoting Server accepts multiple
connections from multiple clients, and they're all sending messages or using
methods? Does it (server) manage this automatically?

Aug 3 '05 #1
3 14830
On Wed, 3 Aug 2005 13:55:00 -0700, JSheble wrote:
I understand the difference between the two types (Singleton & SingleCall)
but what affect does this have if the Remoting Server accepts multiple
connections from multiple clients, and they're all sending messages or using
methods? Does it (server) manage this automatically?


Yes. If you published your object as a Singleton (or used Remoting.Marshall
to publish your object), the server will make sure that there is always at
most one instance of your object created and all your clients will always
access the same object.

If you publish your object as Single Call, then the server will alwasy
create a new instance of the object whenever a client calls one of its
method and will destroy the object afterwards, which ensures you that
you'll never have 2 clients or the same client accessing the same instance
twice.
Aug 3 '05 #2
Ok, but I'm still a bit confused about multiple clients connecting to a
Singleton object... what if multiple clients all call the same method
simultaneously? Say 3 clients all call the same method, does the 2nd and
3rd call wait until the first finishes? Meaning does it queue the calls?
"Mehdi" <vi****@REMOVEME.gmail.com> wrote in message
news:1v******************************@40tude.net.. .
On Wed, 3 Aug 2005 13:55:00 -0700, JSheble wrote:
I understand the difference between the two types (Singleton &
SingleCall)
but what affect does this have if the Remoting Server accepts multiple
connections from multiple clients, and they're all sending messages or
using
methods? Does it (server) manage this automatically?


Yes. If you published your object as a Singleton (or used
Remoting.Marshall
to publish your object), the server will make sure that there is always at
most one instance of your object created and all your clients will always
access the same object.

If you publish your object as Single Call, then the server will alwasy
create a new instance of the object whenever a client calls one of its
method and will destroy the object afterwards, which ensures you that
you'll never have 2 clients or the same client accessing the same instance
twice.

Aug 3 '05 #3
JSheble wrote:
Ok, but I'm still a bit confused about multiple clients connecting to a
Singleton object... what if multiple clients all call the same method
simultaneously? Say 3 clients all call the same method, does the 2nd and
3rd call wait until the first finishes? Meaning does it queue the calls?


If I'm not completely mistaken, it runs multiple threads, one for each
incoming request. That's why it's important to code Singleton objects
thread-safe for use in Remoting.

Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619 http://www.sturmnet.org/blog
Aug 4 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Sudesh Sawant | last post: by
1 post views Thread by Greg Bacchus | last post: by
1 post views Thread by Jignesh | last post: by
3 posts views Thread by JSheble | last post: by
2 posts views Thread by hharry | last post: by
6 posts views Thread by Palvinder Singh | last post: by
3 posts views Thread by =?Utf-8?B?ZmFpcnl2b2ljZQ==?= | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.