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 theTP::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 thetmshutdown(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 theServer::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, theTP::unregister_factory()
method accesses the FactoryFinder Registrar object that resides in a separate server. TheTP::unregister_factory()
method is typically invoked from therelease()
method; therefore, the FactoryFinder server should be shut down after all servers that callTP::unregister_factory()
in theirServer::release()
method.
Parent topic: Server::release()