AutoCommit Property

Syntax:

public bool AutoCommit { get; set; }

Description:

Type: System.Boolean

Gets or sets the auto commit mode of the connection. The auto commit mode determines whether a transaction has to be started explicitly or not. If auto commit is on then each executed statement will automatically start and end a transaction if an existing transaction is not already started. Explicit transactions can still be created but are not required. If auto commit is not on then transactions must be explicitly started and ended.

While auto commit is a nice convenience, most serious database applications will want to disable this mode so that changes that are related will all occur within a single transaction. This way they will either all be committed or none will.

The default connection has auto commit mode enabled.

Exceptions:

None