Exemplo n.º 1
0
        private void DisposeSession(SessionDataContext ctx)
        {
            try
            {
                if (_scope != null)
                {
                    using (CodeMarker.MarkBlock("Session.ScopeDispose"))
                    {
                        _scope.Dispose();
                    }
                }
            }
            catch (Exception ex)
            {
                var exception = ex;
                if (exception is AggregateException)
                {
                    exception = ((AggregateException)ex).InnerException;
                }
                Log(new DiagnosticMessage(MessageType.Error, exception.Message, "Session", SessionDataContext.InValidationProcess, null, exception));
            }
            _scope = null;

            try
            {
                // Libération des locks
                Store.LockManager.ReleaseLocks(ctx.Locks, ctx.Aborted);
            }
            catch (Exception ex)
            {
                throw new CriticalException(ExceptionMessages.CriticalErrorMaybeAwaitInSession, ex);
            }

            // Suppression de la session courante. Il n'est plus possible de faire référence à la session
            ctx.Current        = null;
            SessionDataContext = null;
            ResetSessionIndex(true);
        }
Exemplo n.º 2
0
 public void TearDown()
 {
     _scope?.Dispose();
 }
Exemplo n.º 3
0
 public void Dispose()
 {
     Transaction.Dispose();
 }
 public void Finish()
 {
     CurrentTransactionScope.Commit();
     CurrentTransactionScope.Dispose();
 }