Release

Releases use of the current connection and returns it to the connection pool.

Inputs

Database connection
A CwDBConnection object that represents the database connection.

Exceptions

The Release function block can throw the CwDBConnectionException exception.

Notes

The Release function block explicitly releases use of the current connection by the collaboration object. 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 collaboration object implicitly releases it at the end of the current collaboration run. Therefore, you cannot save a connection in a static variable and reuse it.

Important

Do not use Release 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 collaboration. Therefore, use of this function block 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 In Transaction function block to determine whether a transaction is active.

Related information

This function block is based on the CwDBConnection.release() method. For more information, see release().

Copyright IBM Corp. 1997, 2004