Distributed Transactions

Thus far, our discussion has been limited to transactions on a single database. What if more than one database is involved? What if more than one database server is involved? What if a nondatabase operation, such as modifying an in-memory cache, is involved? Can you use BEGIN TRANSACTION to bind other such operations within a single transaction? Unfortunately, you cannot. BEGIN TRANSACTION works only on local transactions dealing with data in a database. These transactions do not apply to an in-memory cache, because no transaction logging mechanism is available.

In this section, we’ll look at a deeper theory of transactions and explore the Transaction Management API in the .NET Framework System.Transactions namespace. You’ll ...

Get Programming Microsoft® SQL Server® 2012 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.