Esempio n. 1
0
 internal DbTrans(DbProvider dbProvider, IsolationLevel isolationLevel)
 {
     this.dbConnection = dbProvider.CreateConnection();
     this.dbConnection.Open();
     this.dbTransaction = dbConnection.BeginTransaction(isolationLevel);
     this.dbProvider    = dbProvider;
     this.dbBatch       = new DbBatch(dbProvider, this);
 }
Esempio n. 2
0
 /// <summary>
 /// 以BbConnection方式实例化一个事务
 /// </summary>
 /// <param name="dbProvider"></param>
 /// <param name="dbConnection"></param>
 internal DbTrans(DbProvider dbProvider, DbConnection dbConnection)
 {
     this.dbConnection = dbConnection;
     if (this.dbConnection.State != ConnectionState.Open)
     {
         this.dbConnection.Open();
     }
     this.dbProvider = dbProvider;
     this.dbBatch    = new DbBatch(dbProvider, this);
 }
Esempio n. 3
0
 internal DbTrans(DbProvider dbProvider, bool useTrans)
 {
     if (useTrans)
     {
         this.dbConnection = dbProvider.CreateConnection();
         this.dbConnection.Open();
         this.dbTransaction = dbConnection.BeginTransaction();
     }
     this.dbProvider = dbProvider;
     this.dbBatch    = new DbBatch(dbProvider, this);
 }