TransactionScopeOption vs TransactionScopeOptions
TransactionScopeOption in System.Transaction What is the differences between TransactionScopeOptions when we use it to create TransactionScope. We have the following option at our disposal. 1. TransactionScopeOption.Required TransactionScope created here is dependent on the root TransactionScope. 2. TransactionScopeOption.RequiresNew Creates an entirely new TransactionScope 3. TransactionScopeOption.Suppress TransactionScope created here is independent of root TransactionScope. Code below shows an example of how transactionScope takes effect when you stop your application in s1.Complete(); Data gets committed in TransactionScopeMixRequiresNew and TransactionScopeMixSupress method but not TransactionScopeMixRequires. using (TransactionScope s1 = new TransactionScope(TransactionScopeOption.Required)) { TransactionScopeMixRequires(); TransactionScopeMixRequiresNew(); TransactionScopeMixSupress(); /// if you stop your application here /// TransactionScopeMixRequiresNew and Tra...