コード例 #1
0
 /// <summary>
 /// Gets database  transaction associated with the given connection string. This is the actual database transaction that is to be
 /// shared for all communication with this database.
 /// </summary>
 internal IDbTransaction GetDbTransaction(string connectionString, IDBProvider dbProvider)
 {
     // if this in not the real transaction, forward the call to real transaction
     if (this.realGlobalTransaction == null)
     {
         if (!this.openTransactions.ContainsKey(connectionString))
         {
             IDbConnection connection = dbProvider.CreateConnection(connectionString);
             connection.Open();
             this.openTransactions.Add(connectionString, connection.BeginTransaction());
         }
         return this.openTransactions[connectionString];
     }
     else
     {
         return this.realGlobalTransaction.GetDbTransaction(connectionString, dbProvider);
     }
 }