Transaction Processing

Often, updates to tables must occur as a grouped operation. For instance, suppose that within an operation you must update multiple tables. If the update operation on any of the tables fails, the entire operation must fail. This includes previous updates to other tables within the same operation.

This type of protection can be achieved using transaction processing. Transactions are statements that define the beginning and ending of operation boundaries. Transactions are represented by the SqlTransaction class. This class is returned as the result of the SqlConnection.BeginTransaction() method.

When a transaction is invoked, all operations through the specified connection occur within the transaction’s boundaries. When the ...

Get Delphi for .NET Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.