Releasing connections
When you connect to remote locations explicitly, you must also terminate those connections explicitly.
About this task
To break the connections, you can use the RELEASE statement.
The RELEASE statement differs from the CONNECT statement in the following
ways:
- While the CONNECT statement makes an immediate connection, the RELEASE statement does not immediately break a connection. The RELEASE statement labels connections for release at the next commit point. A connection that has been labeled for release is in the release-pending state and can still be used before the next commit point.
- While the CONNECT statement connects to exactly one remote system, you can use the RELEASE statement to specify a single connection or a set of connections for release at the next commit point.
Example
By using the RELEASE statement, you can place any of the
following connections in the release-pending state:
- A specific connection that the next unit of work does not use:
EXEC SQL RELEASE SPIFFY1;
- The current SQL connection, whatever its location name:
EXEC SQL RELEASE CURRENT;
- All connections except the local connection:
EXEC SQL RELEASE ALL;