Share via


SqliteConnection.BeginTransaction Method

Definition

Overloads

BeginTransaction()

Begins a transaction on the connection.

BeginTransaction(Boolean)

Begins a transaction on the connection.

BeginTransaction(IsolationLevel)

Begins a transaction on the connection.

BeginTransaction(IsolationLevel, Boolean)

Begins a transaction on the connection.

BeginTransaction()

Begins a transaction on the connection.

public virtual Microsoft.Data.Sqlite.SqliteTransaction BeginTransaction ();
override this.BeginTransaction : unit -> Microsoft.Data.Sqlite.SqliteTransaction
Public Overridable Function BeginTransaction () As SqliteTransaction

Returns

The transaction.

Exceptions

A SQLite error occurs during execution.

Applies to

BeginTransaction(Boolean)

Begins a transaction on the connection.

public virtual Microsoft.Data.Sqlite.SqliteTransaction BeginTransaction (bool deferred);
override this.BeginTransaction : bool -> Microsoft.Data.Sqlite.SqliteTransaction
Public Overridable Function BeginTransaction (deferred As Boolean) As SqliteTransaction

Parameters

deferred
Boolean

true to defer the creation of the transaction. This also causes transactions to upgrade from read transactions to write transactions as needed by their commands.

Returns

The transaction.

Exceptions

A SQLite error occurs during execution.

Remarks

Warning, commands inside a deferred transaction can fail if they cause the transaction to be upgraded from a read transaction to a write transaction but the database is locked. The application will need to retry the entire transaction when this happens.

Applies to

BeginTransaction(IsolationLevel)

Begins a transaction on the connection.

public virtual Microsoft.Data.Sqlite.SqliteTransaction BeginTransaction (System.Data.IsolationLevel isolationLevel);
override this.BeginTransaction : System.Data.IsolationLevel -> Microsoft.Data.Sqlite.SqliteTransaction
Public Overridable Function BeginTransaction (isolationLevel As IsolationLevel) As SqliteTransaction

Parameters

isolationLevel
IsolationLevel

The isolation level of the transaction.

Returns

The transaction.

Exceptions

A SQLite error occurs during execution.

Applies to

BeginTransaction(IsolationLevel, Boolean)

Begins a transaction on the connection.

public virtual Microsoft.Data.Sqlite.SqliteTransaction BeginTransaction (System.Data.IsolationLevel isolationLevel, bool deferred);
override this.BeginTransaction : System.Data.IsolationLevel * bool -> Microsoft.Data.Sqlite.SqliteTransaction
Public Overridable Function BeginTransaction (isolationLevel As IsolationLevel, deferred As Boolean) As SqliteTransaction

Parameters

isolationLevel
IsolationLevel

The isolation level of the transaction.

deferred
Boolean

true to defer the creation of the transaction. This also causes transactions to upgrade from read transactions to write transactions as needed by their commands.

Returns

The transaction.

Exceptions

A SQLite error occurs during execution.

Remarks

Warning, commands inside a deferred transaction can fail if they cause the transaction to be upgraded from a read transaction to a write transaction but the database is locked. The application will need to retry the entire transaction when this happens.

Applies to