Exemple #1
0
        private static void ReleaseTransaction()
        {
            if (_transConnectionObj == null)
            {
                return;
            }
            DbConnection conn = _transConnectionObj.MyDbTransaction.Connection;

            _transConnectionObj.MyDbTransaction.Dispose();
            _transConnectionObj = null;
            CloseConn(conn);
        }
Exemple #2
0
 public static void BeginTransaction()
 {
     if (_transConnectionObj == null)
     {
         DbConnection conn = _dataProviders.GetDbConnection(_dataProviders.ConnectionString);
         OpenConn(conn);
         DbTransaction trans = conn.BeginTransaction();
         _transConnectionObj = new TransConnection {
             MyDbTransaction = trans
         };
     }
     else
     {
         _transConnectionObj.Deeps += 1;
     }
 }