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 ...

Get Pro LINQ: Language Integrated Query in C# 2008 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.