[Pgsql-ayuda] Auto Commit

Solón Cáceres Moreno cdmb@epm.net.co
Fri, 14 Jun 2002 12:06:56 -0500


Saludos desde Bucaramanga, Colombia. Esto fu=E9 lo que encontr=E9.

Sol=F3n C=E1ceres Moreno



postgreSQL.connection.setAutoCommit
Syntax
postgreSQL.connection.setAutoCommit (connectionRef, flAutoCommit)

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

flAutoCommit is a boolean indication whether to switch auto-commit mode o=
n
or off.

Action
Switch auto-commit mode on if flAutoCommit is true, otherwise switch it o=
ff.

Returns
True.

Examples
postgreSQL.connection.setAutoCommit (connectionRef, true)

=AB true

Notes
By default, auto-commit mode is switched off. This means that all databas=
e
queries run inside a transaction with the transaction isolation level set=
 to
serializable. Therefore, any changes you make to the database will not
become permanent and visible to other users until you call
postgreSQL.connection.commit.

The PostgreSQL extension keeps track internally of when you committed or
rolled back transactions, so that it will only send the respective comman=
ds
to the database server when neccessary. For this feature to work correctl=
y,
you should refrain from running BEGIN, COMMIT, END, or ABORT commands
directly through the query interface while auto-commit mode is switched o=
ff.

Switching auto-commit mode on will cause every query to be run in its own
transaction, and you can also safely send BEGIN, COMMIT, END, or ABORT
commands directly through the query interface