示例#1
0
 public SQLExtDataReader(DbCommand cmd, CommandBehavior behaviour, SQLExtTransaction <TConn> txn = null, SQLExtTransactionLock <TConn> txnlock = null)
 {
     this.command     = cmd;
     this.InnerReader = cmd.ExecuteReader(behaviour);
     this.transaction = txn;
     this.txnlock     = txnlock;
 }
示例#2
0
 protected void SetTransaction(DbTransaction txn)
 {
     // We only accept wrapped transactions in order to avoid deadlocks
     if (txn == null || txn is SQLExtTransaction <TConn> )
     {
         transaction = (SQLExtTransaction <TConn>)txn;
         InnerCommand.Transaction = transaction.InnerTransaction;
     }
     else
     {
         throw new InvalidOperationException(String.Format("Expected a {0}; got a {1}", typeof(SQLExtTransaction <TConn>).FullName, txn.GetType().FullName));
     }
 }