Check if object is still bound to NameService (tnameserv)

535 Views Asked by At

Is there an easy way to check whether an object is still bound to a "tnameserv" ? After you bind an object, the "tnameserv" process might crash, be killled, ... and I want my application to verify whether an object that I bound earlier is still bound.

1

There are 1 best solutions below

1
On BEST ANSWER

Assuming you're using the Oracle Java ORB, why not use the persistent name service which they provide rather than the transient tnameserv? It sounds like your application needs a persistent registration of references, so trying to get persistent-like behavior from a transient naming service will likely be a dead-end.

BTW you can use any vendor's COS Naming Service, and not just the one provided by Oracle (nor does it even have to be written in Java, either). For example, the free JacORB Name Server can run in a persistent mode, allowing the references you register to survive a restart or crash of the service.

In any case, the answer to your question depends on whether or not you're asking it from the client's or server's perspective. A server using the Naming Service shouldn't need to check that there's an existing reference of its own already registered in there - it should instead just call rebind() to update the registration. If there's nothing in there already, the reference will be added. If there's one in there, it will get overwritten with the new value.

If you're asking about this from your client's perspective, you should remember that the Naming Service is like a phone book. If the client doesn't find a registration in there that it requires, it's pretty much dead in the water unless it can find other suitable objects which could be used to provide the services you need. It's probably better to have your client fail at that point rather than try to guess at how to compensate for what is really a catastrophic scenario.