Select from following answers:- Embed calls to the SubmitChanges method within a TransactionScope with TransactionScopeOption set to RequiresNew. Call Complete after the updates.
- Embed calls to the DataContext.GetTable<T> methods within a TransactionScope. Call Complete after the tables are retrieved.
- Call the BeginTransaction and Commit methods on the Connection property of each DataContext.
- All Above
By default, DataContext updates occur in the context of the ambient transaction, if there is one. To ensure that a new one is created for the scope of the two updates, use a TransactionScope with the TransactionScopeOption set to RequiresNew. Call Complete after the updates to commit changes in this scope.
Embedding calls to the DataContext.GetTable<T> methods within a TransactionScope does not ensure that the updates are transactional.
Show Correct Answer
Source: MeasureUp.Com | |
Alert Moderator