Show: Delphi C++
Display Preferences

FireDAC.Stan.Option.TFDTxOptions.AutoCommit

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property AutoCommit: Boolean read GetAutoCommit write SetAutoCommit  stored False default True;

C++

__property bool AutoCommit = {read=GetAutoCommit, write=SetAutoCommit, stored=false, default=1};

Properties

Type Visibility Source Unit Parent
property published
FireDAC.Stan.Option.pas
FireDAC.Stan.Option.hpp
FireDAC.Stan.Option TFDTxOptions

Description

Controls the automatic completion of a transaction.

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

If AutoCommit is True, then FireDAC will execute the following:

  • Start the transaction (if required) before each SQL command.
  • Finish the transaction started after the SQL command execution. If the command is successful, then FireDAC will issue COMMIT, otherwise--ROLLBACK.

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

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

See Also

Samples

Personal tools
In Other Languages
Previous Versions
Assistance