Groups | Blog | Home
all groups > dotnet remoting > february 2004 >

dotnet remoting : Using EnterpriseServices with Remoting


Manfred Steyer
2/29/2004 11:09:43 AM
Hi!

I want to use a serviced Component using JITA and Object Pooling as a server
activated remoting component, as ServicedComponent inherits
MarshalByRefObject.

As the Component uses JITA and Object Pooling, it's stateless.

I'm wondering, wheter I should export it as a "Single Call" or a
"Singleton"-Object.

If I use it as a Singleton, what will happen, if a client calls a method on
this object ?
I suggest, that an instance is taken from the pool and activated and that
after the
method has been executed it is deactivated and returned to the pool. - But
I'm not really sure,
as that would mean, that there are many (pooled) instances of a Singleton.

Are there best practices for this kind of application architecture ?

Best Regards,
Manfred


Raghu
3/1/2004 8:05:00 AM
Microsoft clearly advises against hosting remoting object in COM+ server
application. See
http://support.microsoft.com/default.aspx?scid=kb;en-us;322627

When configure remoting to Singleton object, you won't get more than many
instances. So there is no use for object pooling except if you want to pool
one object. Is this not equivalent to configuring single call objects with
min and max equal to one?

Here is the bad news. When you use JITA, the synchronization defaults to
Required. The only other available option is Required New. Both options are
bad because all the incoming calls will be serialized. If you are expecting
your singleton object to be hit with multiple threads simultaneously, it
won't happen. The serialization is required because you limited the number
of objects to one and JIT can not accept multiple calls on the same
instance. Also if there are lots of outstanding calls, some calls may fail
when creation time set in COM+ exceeds.

You would be better off with singleton remote object hosted in another host.
A window service can be used as host.

My 2 cents.

Thanks.
Raghu/..

[quoted text, click to view]

AddThis Social Bookmark Button