12.8. Using transactions
A transaction is a series of operations performed as single unit of work. All operations in a transaction must be completed successfully in order to make the transaction successful. The transaction has a beginning and an end that specify the boundary of the transaction. Usually we use transactions in a stored procedure with the help of BEGIN TRANSACTION and COMMIT/ROLLBACK TRANSACTION statements – these allow us to run the transaction in a single round trip to the database server.
ADO.NET supports manual transactions – we can control the transaction boundary and explicitly start and end transactions. To perform operations within a single transaction, we need to create an SqlTransaction or OleDbTransaction object and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access