AnyDAC
ContentsIndexHome
PreviousUpNext
TADTxOptions.AutoCommit Property

Controls the automatic completion of transaction.

Group
Links

Use AutoCommit property to control automatic transaction management. The default value is True. 

If AutoCommit is True, then AnyDAC will:

  • start transaction (if required) before each SQL command;
  • finish started transaction after SQL command execution. If command is successful, then AnyDAC will issue COMMIT, otherwise - ROLLBACK.

If application has called StartTransaction method, then automatic transaction management will be disabled until corresponding Commit or Rollback method call. In general, there is no need to set AutoCommit property value to False, just use explicit transaction control (StartTransaction, Commit, Rollback) when you need it. 

Depending on DBMS, AnyDAC uses either native DBMS API for automatic transaction management, either emulates automatic transaction management. At moment only Interbase of Firebird are requiring emulation. In case of emulation setting AutoCommit to True is shortcut to setting AutoStart and AutoStop to True and including xoIfAutoStarted and xoIfCmdsInactive into StopOptions.

property AutoCommit: Boolean;
What do you think about this topic? Send feedback!