postgreSQL.connection.release

Syntax

postgreSQL.connection.release (connectionRef)

Params

connectionRef is a reference to a connection as returned by postgreSQL.connection.grab.

Action

Releases exclusive control of the specified connection and makes it available for re-use.

Returns

True.

Examples

postgreSQL.connection.release (connectionRef)

« true

Notes

To conserve system resources both on the client and the server, it is critically important that you call this verb when you no longer need a connection obtained by calling postgreSQL.connection.grab. All code executed after grabbing a connection should run inside a try statement with the corresponding else block taking care of releasing the connection even in case a script error is encountered.

When you call this verb, any changes you made to the database that have not yet been committed will be rolled back automatically, unless you previously switched the connection to auto-commit mode.

All cursors belonging to the specified connection that have not already been disposed when you call this verb will be disposed automatically. This means that after you called this verb, all references to cursors belonging to the released connection have become invalid.

See Also

postgreSQL.connection.grab

postgreSQL.connection.commit

postgreSQL.connection.setAutoCommit