TSqlTransaction

Represents a transaction in a database.

Inheritance

LevelAncestorDescription
1TObjectUltimate ancestor in a class hierarchy
2TSqlTransaction

Source

Sql.Transaction.pas (25)

Description

A transaction groups statements that should succeed or fail as a whole in order to maintain the database in a consitent state. Once all statements have been executed and the transaction can be committed the application should call SetSuccessful. Depending on IsSuccessful TSqlDatabase.EndTransaction either commits or rolls back the transactions. The following pattern should be used:

1 2 3 4 5 6 7 8 Transaction := Database.StartTransaction(); try ExecuteStatements(); Transaction.SetSuccessful(); finally Database.EndTransaction(Transaction); end;

Fields

ScopeVisibilityTypeNameDescription
InstanceprivateTBooleanFIsSuccessful
InstanceprivateTBooleanFCommentSet
InstanceprivateTTextFComment

Methods

ScopeVisibilityResultNameDescription
InstanceprivateSetComment(Comment: TText)
InstanceprivateTTextGetComment()
InstancepublicSetSuccessful()