postgreSQL.connection.commit

Syntax

postgreSQL.connection.commit (connectionRef)

Params

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

Action

Commit all changes that are part of the current transaction and begin a new transaction.

Returns

True.

Examples

postgreSQL.connection.commit (connectionRef)

« true

Notes

By default, all database queries run inside a transaction with the transaction level set to serializable. Any changes you make to the database will not become permanent and visible to other users until you call this verb. You should also call it before closing or releasing the connection, unless you want all the changes you made after last calling this verb to be rolled back.

The PostgreSQL extension keeps track internally of when you committed or rolled back transactions, so that it will only send the respective commands to the database server when neccessary. For this feature to work correctly, you should refrain from running BEGIN, COMMIT, END, or ABORT commands directly through the query interface and instead only call this verb and the associated postgreSQL.connection.rollback verb to manage transactions.

If the connection has been switched to auto-commit mode, this verb has no effect and you can safely run BEGIN, COMMIT, or ABORT commands directly through the query interface.

See Also

postgreSQL.connection.rollback

postgreSQL.connection.setAutoCommit