release()

Releases use of the current connection, returning it to its connection pool.

Syntax

void release()
 

Parameters

None.

Return values

None.

Exceptions

CwDBConnectionException
 

Notes

The release() method explicitly releases use of the current connection by the map instance. Once released, the connection returns to its connection pool, where it is available for other components (maps or collaborations) that require a connection to the associated database. If you do not explicitly release a connection, the map instance implicitly releases it at the end of the current map run. Therefore, you cannot save a connection in a static variable and reuse it.

Attention:
Do not use the release() method if a transaction is currently active. With implicit transaction bracketing, ICS does not end the database transaction until it determines the success or failure of the map. Therefore, use of this method on a connection that uses implicit transaction bracketing results in a CwDBTransactionException exception. If you do not handle this exception explicitly, it also results in an automatic rollback of the active transaction. You can use the inTransaction() method to determine whether a transaction is active.

See also

getDBConnection(), inTransaction(), isActive()

Copyright IBM Corp. 1997, 2003