/// <summary> /// commit the transaction /// </summary> public void SaveChanges() { try { Trans?.Commit(); } catch { Rollback(); throw; } finally { OpenedDataReaders.Clear(); Trans?.Dispose(); SqlConnection?.Dispose(); Trans = null; SqlConnection = null; } }
/// <summary> /// commit the transaction /// </summary> public void SaveChanges() { try { Trans?.Commit(); } catch (Exception ex) { Rollback(); throw new EntityException(ex.Message); } finally { OpenedDataReaders.Clear(); Trans?.Dispose(); SqlConnection?.Dispose(); Trans = null; SqlConnection = null; } }
/// <summary> /// commit the transaction /// </summary> public void Commit() { Trans?.Commit(); Dispose(); }
/// <summary> /// 提交 /// </summary> public void Commit() { Trans.Commit(); isCommitOrRollback = true; Close(); }
/// <summary> /// 提交一个事务 /// </summary> public void CommitTrans() { Trans.Commit(); TransStats = 3; }