private void Commit()
        {
            _logger.Trace(() => "Committing (" + _persistenceTransactionId + ").");
            var exceptions = new List <Exception>();

            Try(
                BeforeClose,
                () => BeforeClose = null,
                exceptions);

            Try(
                !exceptions.Any() ? (Action)CommitTransaction : (Action)RollbackTransaction,
                () => _transaction = null,
                exceptions);

            Try(
                CloseConnection,
                () => _connection = null,
                exceptions);

            if (exceptions.Any())
            {
                ExceptionsUtility.Rethrow(exceptions.First());
            }

            AfterClose?.Invoke();
            AfterClose = null;
        }
Exemplo n.º 2
0
        internal void Close()
        {
            var args = new EventArgs();

            try
            {
                Closing?.Invoke(this, args);
            }
            // ReSharper disable once EmptyGeneralCatchClause
            catch
            {
            }
            AfterClose?.Invoke(this, args);
        }
Exemplo n.º 3
0
 private void OnAfterClose(object sender, NavigateEventArgs e)
 {
     AfterClose?.Invoke(sender, e);
 }
Exemplo n.º 4
0
 protected virtual void OnAfterClose(object sender, NavigateEventArgs e)
 {
     AfterClose?.Invoke(sender, e);
 }
Exemplo n.º 5
0
 protected void DoAfterClose()
 {
     State = DatabaseState.Closed;
     AfterClose?.Invoke(this, new EventArgs());
 }