Databases and Connections
The DB XA Module does not open connections to a database server. Instead, it makes use of connections previously opened by the TPM. Therefore, the DB XA Module does not make use of Oracle OCI calls such as OCIServerAttach(), OCISessionBegin() and OCISessionEnd(), since those calls explicitly establish connections to database servers.
To obtain a valid environment handle and service context handle, the DB XA Module uses function calls xaoEnv() and xaoSvcCtx(), respectively, for a connection previously opened by the TPM. The signatures for these routines are:
 
OCIEnv *xaoEnv(text *dbname)
OCISvcCtx *xaoSvcCtx(text *dbname)
The dbname parameter has the same value as the xaParameter argument that you pass in as the propertyString parameter for RWDBManager::database(). That is, function xaoEnv returns the environment handle, already allocated by the TPM, that corresponds to the dbName parameter. Likewise, function xaoSvcCtx returns the service context handle, already allocated by the TPM, that corresponds to the dbName parameter. If dbname is a null pointer, these functions respectively return environment and service context handles for the default connection.