Problem:

  • Product Name: VisiBroker
  • Platform/OS version: ALL

The server application will maintain a limited pool of shared resources such as database connection. When the client application connects, the server application will allocates resource to it. How can a server application detect if a client has disconnected/died?

Resolution:

A transient CORBA object can be instantiated on the client which will implement an is_connected function. The server will invoke the non_existent function. If the client process is terminated or connection disconnected, the following exceptions will be thrown.

1. CORBA::COMM_FAILURE
2. CORBA::TRANSIENT
3. CORBA::OBJECT_NOT_EXIST

The 1st and 2nd exceptions are connection related. The last exception indicates the CORBA object is no longer active in the Active Object Map in the POA. The server application need to catch all the above exception and determine when to release the resources associated for a particular application client.