public virtual void Connect(String connectionString)
 {
     CurrentConnection = DbProviderFactory.CreateConnection();
     CurrentConnection.ConnectionString = connectionString;
     CurrentConnection.Open();
     CurrentTransaction = CurrentConnection.BeginTransaction();
 }
Esempio n. 2
0
 public void BeginTransaction()
 {
     CurrentConnection = GetDbConnection(DataSourceEnum.MASTER);
     if (CurrentConnection.State == ConnectionState.Closed)
     {
         CurrentConnection.Open();
     }
     CurrentTransaction = CurrentConnection.BeginTransaction();
 }
Esempio n. 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();
 }
Esempio n. 6
0
        public IDbTransaction BeginTransction()
        {
            Transaction = CurrentConnection.BeginTransaction();

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