Sign in Join
FPDoc Onlineexperiment

TSQLTransaction.Rollback procedure

Member of TSQLTransactionpublicIn unit SQLDB

Roll back all changes made in the current transaction.

Declaration

pascal
procedure Rollback; override

Description

Rollback undoes all changes in the database since the start of the transaction. It can only be executed in an active transaction.

After this, the transaction is no longer active. To undo changes but keep an active transaction, execute RollbackRetaining instead.

Changes posted in datasets that are coupled to this transaction will not be undone in memory: these datasets must be reloaded from the database (using Close and Open to reload the data as it is in the database.

Errors

Executing Rollback when no transaction is active will result in an exception. A transaction must be started by calling StartTransaction. If the database backend reports an error, an exception is raised as well.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.