public void BeginTransaction(DbIsolationLevel isolationLevel = DbIsolationLevel.Unspecified) { _objectContext = ((IObjectContextAdapter)_dataContext).ObjectContext; if (_objectContext.Connection.State != ConnectionState.Open) { _objectContext.Connection.Open(); } _transaction = _objectContext.Connection.BeginTransaction(isolationLevel.ConvertLevel()); }
public void BeginTran(DbIsolationLevel level) { this.OpenConnect(); if (tran == null) { tran = this.Connection.BeginTransaction(); } else { throw new Exception("Transaction is use"); } }
public static IsolationLevel ConvertLevel(this DbIsolationLevel level) { switch (level) { case DbIsolationLevel.Chaos: return(IsolationLevel.Chaos); case DbIsolationLevel.ReadCommitted: return(IsolationLevel.ReadCommitted); case DbIsolationLevel.ReadUncommitted: return(IsolationLevel.ReadUncommitted); case DbIsolationLevel.RepeatableRead: return(IsolationLevel.RepeatableRead); case DbIsolationLevel.Serializable: return(IsolationLevel.Serializable); case DbIsolationLevel.Snapshot: return(IsolationLevel.Snapshot); case DbIsolationLevel.Unspecified: return(IsolationLevel.Unspecified); default: return(IsolationLevel.Unspecified); } }
public void BeginTran(DbIsolationLevel level) { throw new NotImplementedException(); }
public void BeginTransaction(DbIsolationLevel isolationLevel = DbIsolationLevel.Unspecified) { _transaction.GetDbTransaction(); }
public IDbTransaction BeginTransaction(DbIsolationLevel isolationLevel) { return((IDbTransaction)Database.BeginTransaction()); }
public Task BeginTransactionAsync(DbIsolationLevel isolationLevel) { throw new NotImplementedException(); }
public void BeginTran(DbIsolationLevel level) { this.db.BeginTran(level); }