I want to use TransactionScope
in my project. I read about it and I found that it creates an implicit transaction in the database. I want to know if that TransactionScope
locks tables that it manipulates?
For example in this code:
using (Entities ent = new Entities())
{
using (TransactionScope tran = Common.GetTransactionScope())
{
var oldRecords = ent.tblUser.Where(o => o.UserID == UserID);
foreach (var item in oldRecords)
{
ent.tblUser.DeleteObject(item);
}
and
public static TransactionScope GetTransactionScope()
{
TransactionOptions transactionOptions = new TransactionOptions();
transactionOptions.IsolationLevel = System.Transactions.IsolationLevel.Serializable;
return new TransactionScope(TransactionScopeOption.Required, transactionOptions);
}
Is tblUser
locked until Complete
command issue?
Does IsolationLevel
in explicit transaction similar to implicit transaction?
Thanks