public override void OnAutoFlush(AutoFlushEvent @event) { try { base.OnAutoFlush(@event); } catch (AssertionFailure) { } }
/// <summary> /// Called when [auto flush]. /// </summary> /// <param name="event">The @event.</param> public override void OnAutoFlush(AutoFlushEvent @event) { try { base.OnAutoFlush(@event); } catch (AssertionFailure e) { Logger.WarnException("AssertionFailure occurred in " + GetType().Name, e); } }
/// <summary> /// Handle the given auto-flush event. /// </summary> /// <param name="event">The auto-flush event to be handled.</param> /// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param> public virtual async Task OnAutoFlushAsync(AutoFlushEvent @event, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); IEventSource source = @event.Session; if (FlushMightBeNeeded(source)) { using (source.SuspendAutoFlush()) { int oldSize = source.ActionQueue.CollectionRemovalsCount; await(FlushEverythingToExecutionsAsync(@event, cancellationToken)).ConfigureAwait(false); if (FlushIsReallyNeeded(@event, source)) { if (log.IsDebugEnabled) { log.Debug("Need to execute flush"); } await(PerformExecutionsAsync(source, cancellationToken)).ConfigureAwait(false); PostFlush(source); // note: performExecutions() clears all collectionXxxxtion // collections (the collection actions) in the session if (source.Factory.Statistics.IsStatisticsEnabled) { source.Factory.StatisticsImplementor.Flush(); } } else { if (log.IsDebugEnabled) { log.Debug("Dont need to execute flush"); } source.ActionQueue.ClearFromFlushNeededCheck(oldSize); } @event.FlushRequired = FlushIsReallyNeeded(@event, source); } } }
/// <summary> /// Handle the given auto-flush event. /// </summary> /// <param name="event">The auto-flush event to be handled.</param> public virtual void OnAutoFlush(AutoFlushEvent @event) { IEventSource source = @event.Session; if (FlushMightBeNeeded(source)) { using (source.SuspendAutoFlush()) { int oldSize = source.ActionQueue.CollectionRemovalsCount; FlushEverythingToExecutions(@event); if (FlushIsReallyNeeded(@event, source)) { if (log.IsDebugEnabled()) { log.Debug("Need to execute flush"); } PerformExecutions(source); PostFlush(source); // note: performExecutions() clears all collectionXxxxtion // collections (the collection actions) in the session if (source.Factory.Statistics.IsStatisticsEnabled) { source.Factory.StatisticsImplementor.Flush(); } } else { if (log.IsDebugEnabled()) { log.Debug("Dont need to execute flush"); } source.ActionQueue.ClearFromFlushNeededCheck(oldSize); } @event.FlushRequired = FlushIsReallyNeeded(@event, source); } } }
/// <summary> /// Handle the given auto-flush event. /// </summary> /// <param name="event">The auto-flush event to be handled.</param> public virtual void OnAutoFlush(AutoFlushEvent @event) { IEventSource source = @event.Session; if (FlushMightBeNeeded(source)) { int oldSize = source.ActionQueue.CollectionRemovalsCount; FlushEverythingToExecutions(@event); if (FlushIsReallyNeeded(@event, source)) { if (log.IsDebugEnabled) log.Debug("Need to execute flush"); PerformExecutions(source); PostFlush(source); // note: performExecutions() clears all collectionXxxxtion // collections (the collection actions) in the session if (source.Factory.Statistics.IsStatisticsEnabled) { source.Factory.StatisticsImplementor.Flush(); } } else { if (log.IsDebugEnabled) log.Debug("Dont need to execute flush"); source.ActionQueue.ClearFromFlushNeededCheck(oldSize); } @event.FlushRequired = FlushIsReallyNeeded(@event, source); } }
private bool FlushIsReallyNeeded(AutoFlushEvent @event, IEventSource source) { return(source.ActionQueue.AreTablesToBeUpdated(@event.QuerySpaces) || ((ISessionImplementor)source).FlushMode == FlushMode.Always); }
private bool FlushIsReallyNeeded(AutoFlushEvent @event, IEventSource source) { return source.ActionQueue.AreTablesToBeUpdated(@event.QuerySpaces) || ((ISessionImplementor)source).FlushMode == FlushMode.Always; }
public void OnAutoFlush(AutoFlushEvent e) { OnFlushInternal(e); }
public void OnAutoFlush(AutoFlushEvent @event) { log.Debug("AutoFlushEvent :" + @event); }