3.7.1.4.5 Description

The release callback method, which is invoked as the first step in server shutdown, allows the server application to perform any application-specific cleanup. The user must override the virtual function definition.

Typical tasks performed by the application in this method are as follows:

  • Close XA resource managers.
  • Unregister CORBA object factories that were registered with the FactoryFinder in Server::initialize().
  • Deallocate any server resources not yet released.

This method is normally called in response to a tmshutdown command from the administrator or operator.

The TP Framework provides a default implementation of Server::release(). The default implementation closes XA resource managers for the server. The implementation does this by issuing a tx_close() invocation, which uses the default CLOSEINFO configured for the server's group in the UBBCONFIG file.

It is the responsibility of the application to close any open XA resource managers. This is done by issuing either of the following calls:

  • TP::close_xa_rm()

    Note:

    You must use the TP::close_xa_rm() method if you use the INS bootstrap mechanism to obtain initial object references.
  • Tobj::TransactionCurrent::close_xa_rm(). A reference to the TransactionCurrent object can be obtained from the Bootstrap object. For an explanation of how to obtain a reference to the Bootstrap object, see the section TP::bootstrap(). For more information about the TransactionCurrent object, see CORBA Bootstrapping Programming Reference and Using CORBA Transactions.

    Note:

    Once a server receives a request from the tmshutdown(1) command to shut down, it can no longer receive requests from other remote objects. This may require servers to be shut down in a specific order. For example, if the Server::release() method in Server 1 needs to access a method of an object that resides in Server 2, Server 2 should be shut down after Sever 1 is shut down. In particular, the TP::unregister_factory() method accesses the FactoryFinder Registrar object that resides in a separate server. The TP::unregister_factory() method is typically invoked from the release() method; therefore, the FactoryFinder server should be shut down after all servers that call TP::unregister_factory() in their Server::release() method.