public virtual void Connect(String connectionString)
 {
     CurrentConnection = DbProviderFactory.CreateConnection();
     CurrentConnection.ConnectionString = connectionString;
     CurrentConnection.Open();
     CurrentTransaction = CurrentConnection.BeginTransaction();
 }
Beispiel #2
0
 public void BeginTransaction()
 {
     CurrentConnection = GetDbConnection(DataSourceEnum.MASTER);
     if (CurrentConnection.State == ConnectionState.Closed)
     {
         CurrentConnection.Open();
     }
     CurrentTransaction = CurrentConnection.BeginTransaction();
 }
Beispiel #3
0
 /// <summary>
 /// Inicia a transação.
 /// </summary>
 public void BeginTransaction()
 {
     CheckDisposed();
     if (_transaction == null)
     {
         CreateConnection();
         if (_isolationLevel == IsolationLevel.Unspecified)
         {
             _transaction = CurrentConnection.BeginTransaction();
         }
         else
         {
             _transaction = CurrentConnection.BeginTransaction(_isolationLevel);
         }
     }
 }
 public void Rollback()
 {
     CurrentTransaction.Rollback();
     CurrentTransaction = CurrentConnection.BeginTransaction();
 }
 public void Commit()
 {
     CurrentTransaction.Commit();
     CurrentTransaction = CurrentConnection.BeginTransaction();
 }
Beispiel #6
0
        public IDbTransaction BeginTransction()
        {
            Transaction = CurrentConnection.BeginTransaction();

            return(Transaction);
        }
Beispiel #7
0
 protected override SqlTransaction CreateTransaction()
 {
     return(CurrentConnection.BeginTransaction());
 }