[omniORB] Question about object ID

David Riddoch djr@uk.research.att.com
Wed, 4 Apr 2001 15:06:20 +0100 (BST)


Hi Patrick,


You don't need to keep creating and destroying servants -- you could keep
a pool of servants and reuse them.  You allocate a servant in preinvoke()
and return it to the pool in postinvoke().

If you want to use the evictor pattern, then you should be using
ServantActivator rather than ServantLocator.  This may be more efficient
if you expect a give object-id to be used multiple times.


Hope that helps,
David



> I am currently using OmniORB300.
> 
> In my current work, it seemed that the use a default servant was the most
> efficient route to take.
> 
> But alas, in OmniORB300 the PortableServer::Current interface is not
> implemented. Since my servant need to know the ObjectID of the object they
> are incarnating (is that even a verb?) to do their work, I had to find a
> workaround.
> 
> I instead went with a POA_PortableServer::ServantLocator that would create
> servants as needed, passing the ObjectID as a parameter in the
> constructor in the 'preinvoke' call. The servant being destroyed in the
> 'postinvoke' call of the locator. I am a bit unhappy with the fact that I
> keep creating and destroying servants for every request... Using the
> evictor pattern would be a potential optimisation...
> 
> 
> My question being: is that a correct 'workaround'?
> 
> Updating to OmniORB303 is unfortunately not an option yet...

And wouldn't help, because it doesn't have PortableServer::Current either.