Show / Hide Table of Contents

Class SLTransaction

A SQLite transaction or savepoint. The main purpose is to automatically rollback if not explicitly committed. Usage: using(var trans = new SLTransaction(db)) { ... trans.Commit(); }

public sealed class SLTransaction : IDisposable

Namespace: Au.Types
Assembly: Au.dll
Inheritance
object
SLTransaction

Constructors

Name Description
SLTransaction(sqlite, string, string)

Begins a SQLite transaction and prepares for automatic rollback if not explicitly committed. Usage: using(var trans = new SLTransaction(db)) { ... trans.Commit(); }

Properties

Name Description
SqlOfDispose

Gets or sets SQL to execute when disposing this variable if not called SLTransaction.Commit or SLTransaction.Rollback. Initially = parameter sqlOfDispose of constructor.

Methods

Name Description
Commit(string)

Executes a commit SQL and disables SLTransaction.Dispose.

Dispose()

Calls SLTransaction.Rollback if not called SLTransaction.Commit or SLTransaction.Rollback.

Rollback(string)

Executes a rollback SQL (if in transaction) and disables SLTransaction.Dispose. Usually don't need to call this function explicitly. It is implicitly called when disposing this variable if the transaction was not committed.