Managing Connections
In an XA environment it is very important to be careful with connections. SourcePro DB provides a mechanism to implicitly create connections whenever a specific operation must access the server without using an explicit connection. This mechanism can lead to a proliferation of connections to the database server. If the client and server do not care about the number of open connections, then proliferation of connections is not a problem.
The DB XA Module, however, does not create its own connections to the database server, but rather obtains them through a third-party TPM. This means that the number of connection objects is limited by the number of connections that the TPM will make available. For example:
Oracle provides only one connection handle per
db_name provided in the
openString sent to the resource manager. For XA-specific information about the Oracle OCI Access Module, see
Oracle OCI Access Module.For Sybase, the maximum number of connections open per LRM name depends on the setting for the
CS_MAX_CONNECT property. This property is set in the
[all] section of the XA configuration file. For XA-specific information about the Sybase Access Module, see
Sybase Access Module.DB2 CLI provides one connection per database alias name, which is provided in the
openString sent to the resource manager. For XA-specific information about the DB2 CLI Access Module, see
DB2 CLI Access Module.The DB XA Module limits the number of valid connections available per
RWDBDatabase object to one, except with Sybase. Any attempt to use more than one connection will result in a
notSupported error. It is possible to use implicit connections, but the number of connections available at the same time through a particular
RWDBDatabase is limited to one.
NOTE: We recommend that you always use explicit connections.
Because the TPM actually opens and closes connections, the following
RWDBConnection member functions should not be called when using the DB XA Module:
RWDBConnection::open() RWDBConnection::close() Using open() and close() functions in the XA environment will produce a notSupported error.