private static void ReleaseTransaction() { if (_transConnectionObj == null) { return; } DbConnection conn = _transConnectionObj.MyDbTransaction.Connection; _transConnectionObj.MyDbTransaction.Dispose(); _transConnectionObj = null; CloseConn(conn); }
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; } }