/// <summary> /// Commits the transaction. /// </summary> private static void CommitTransaction() { TransactionCounter--; if (TransactionCounter == 0 && ActiveTransaction != null) { ActiveTransaction.Commit(); ActiveTransaction.Dispose(); ActiveTransaction = null; } }
/// <summary> /// Commits the current transaction. /// </summary> public virtual void Commit() { EnsureTransactionIsActive(); try { ActiveTransaction.Commit(); } finally { ActiveTransaction.Dispose(); ClearActiveTransaction(); } }
/// <summary> /// Commit transaction /// </summary> private static void CommitTransaction() { TransactionCount--; if (TransactionCount == 0 && ActiveTransaction != null) { ActiveTransaction.Commit(); ActiveTransaction.Dispose(); ActiveTransaction = null; if (log.IsInfoEnabled) { log.Info("활성화된 Transaction을 Commit하고 Dispose했습니다."); } } }
/// <summary> /// 提交事务 /// </summary> public void Commit() { if (wasOpenTransaction) { try { ActiveTransaction.Commit(); } catch (Exception) { ActiveTransaction.Rollback(); throw; } finally { wasOpenTransaction = false; } } }
/// <summary> /// 현재 활성화된 Transaction이 있다면, Commit을 수행한다. /// </summary> /// <exception cref="InvalidOperationException">Current Thread Context에 활성화된 Transaction이 없을 때</exception> public virtual void Commit() { if (IsActiveTransaction == false) { if (IsDebugEnabled) { log.Debug("활성화된 Transaction이 없으므로 반환합니다."); } return; } if (IsActiveTransaction) { try { ActiveTransaction.Commit(); if (log.IsInfoEnabled) { log.Info("Transaction을 Commit 했습니다!!!"); } } catch (Exception ex) { if (log.IsErrorEnabled) { log.ErrorException("Transaction Commit 작업이 실패했습니다.", ex); } throw; } finally { if (IsActiveTransaction) { ActiveTransaction.Dispose(); ActiveTransaction = null; } } } }
public void Complete() { PublishDomainEvents(DomainEvents); DomainEvents.Clear(); ActiveTransaction?.Commit(); }