O'Reilly logo

Pro LINQ: Language Integrated Query in C# 2008 by Joseph C. Rattz Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Transactions

I have already told you that when the SubmitChanges method is called, if a transaction is not already in scope, the SubmitChanges method will create a transaction for you. In doing so, all database modifications attempted during a single SubmitChanges call will be wrapped within a single transaction. This is very convenient, but, what if you need the transaction to extend beyond the scope of a single SubmitChanges method call?

I want to provide an example demonstrating how you would make updates made by multiple SubmitChanges method calls enlist in the same transaction. Even better, I want the SubmitChanges method calls to be updating different databases. In Listing 18-6, I will make changes to a record in both the Northwind database ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required