Esempio n. 1
0
 /// <summary>
 /// 开始所有链接的事务
 /// </summary>
 /// <returns></returns>
 public bool BeginTran()
 {
     foreach (string key in this.connectionList.Keys)
     {
         IDBHelper helper = this.connectionList[key];
         if (!helper.IsOnTransaction)
         {
             helper.BeginTran();
         }
     }
     return(true);
 }
Esempio n. 2
0
 /// <summary>
 /// 开始某个链接的事务
 /// </summary>
 /// <param name="key">要开始事务的链接的key</param>
 /// <returns></returns>
 public bool BeginTran(string key)
 {
     if (this.connectionList.ContainsKey(key))
     {
         IDBHelper helper = this.connectionList[key];
         if (!helper.IsOnTransaction)
         {
             helper.BeginTran();
         }
     }
     else
     {
         return(false);
     }
     return(true);
 }