Transaction Participation

Transaction-aware resources might be enlisted in a transaction. An example of a transaction-aware resource in ADO.NET is a Command object, which has a reference to a Connection object and can be configured to participate in a transaction by setting its Transaction property. When a command is enlisted in a transaction, it executes its database access logic as part of the contained transaction. Such transactional participation allows commands to see the changes of other commands participating in the same transaction before the transaction is completed; it also allows related commands to run as one unit of work and coordinate their changes to assure the consistent state of the system.

Get Test-Driven Development in Microsoft® .NET 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.