[omniORB] How to remove 'expired' objects from omniORB2 BOA in the server i mplementation?

David Riddoch djr@orl.co.uk
Wed, 3 Feb 1999 10:02:57 +0000 (GMT)


Thomas,

Server objects do not maintain a reference count of remote clients. They
only have a reference count of local references (ie local clients, and one
for the BOA). Thus when you call _dispose, the object will be deleted
unless there are any locally held references. Whether or not remote
clients still hold references, or even still exist is not considered. (The
ORB takes care that no calls are in progress when it deletes the object!).

There is no timestamp in the object table. You'll need to implement some
scheme yourself for keeping track of clients. This has been discused quite
a few times on the list - so have a look at the mailing list archive:
  http://www.orl.co.uk/omniORB/archives/
  http://www.orl.co.uk/search.html

I hope this answers your question.

David



On Mon, 1 Feb 1999, Thomas Bednarz wrote:

> I have a little problem with dynamically created objects. I have implemented
> a Factory Object which is the only object registred with the BOA when my
> deamon process starts. This object implements methods to create other
> objects. A client can call such a method and then a special constructor of
> the object is called on the server. The data is retrieved from somewhere to
> 'fill' the object. When the client has finished it should call a function to
> tell the server, that he does not need the object anymore. The
> implementation calls _dispose and/or CORBA::release().
> 
> If I correctly understand the documentation the _dispose function calls
> CORBA::release() only if the reference counter is 0. If it is >0 the object
> remains in the servers memory. This can be the case, if a client does not
> call the remove function or if a client terminates unexpectedly (crashing
> Microsoft PC!) or if the client is a Browser (Servlet / Applet) and the
> activities from there are never terminated. So my server needs to implement
> something like a watchdog who removes expired objects. For all of the
> dynamically created objects, I should set a configurable maximum livetime.
> The question is: is there any possibility to find out how many object
> references exist for a specific active object in the BOA? Is there
> eventually something like a timestamp of the Object activation available?