Does a TransactionScope that exists only to select data require a call to Complete()
- by fordareh
In order to select data from part of an application that isn't affected by dirty data, I create a TransactionScope that specifies a ReadUncommitted IsolationLevel as per the suggestion from Hanselman here.
My question is, do I still need to execute the oTS.Complete() call at the end of the using block even if this transaction scope was not built for the purpose of bridging object dependencies across 2 databases during an Insert, Update, or Delete?
Ex:
List<string> oStrings = null;
using (SomeDataContext oCtxt = new SomeDataContext (sConnStr))
using (TransactionScope oTS = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted }))
{
oStrings = oCtxt.EStrings.ToList();
oTS.Complete();
}