/** * Handle the given dirty-check event. * * @param event The dirty-check event to be handled. * @throws HibernateException */ public void onDirtyCheck(DirtyCheckEvent event) throws HibernateException { int oldSize = event.getSession().getActionQueue().numberOfCollectionRemovals(); try { flushEverythingToExecutions(event); boolean wasNeeded = event.getSession().getActionQueue().hasAnyQueuedActions(); if ( wasNeeded ) { LOG.debug( "Session dirty" ); } else { LOG.debug( "Session not dirty" ); } event.setDirty( wasNeeded ); } finally { event.getSession().getActionQueue().clearFromFlushNeededCheck( oldSize ); } } }
source.getActionQueue().clearFromFlushNeededCheck( oldSize );
/** * Handle the given dirty-check event. * * @param event The dirty-check event to be handled. * @throws HibernateException */ public void onDirtyCheck(DirtyCheckEvent event) throws HibernateException { int oldSize = event.getSession().getActionQueue().numberOfCollectionRemovals(); try { flushEverythingToExecutions(event); boolean wasNeeded = event.getSession().getActionQueue().hasAnyQueuedActions(); if ( wasNeeded ) LOG.debug( "Session dirty" ); else LOG.debug( "Session not dirty" ); event.setDirty( wasNeeded ); } finally { event.getSession().getActionQueue().clearFromFlushNeededCheck( oldSize ); } } }
/** * Handle the given dirty-check event. * * @param event The dirty-check event to be handled. * @throws HibernateException */ public void onDirtyCheck(DirtyCheckEvent event) throws HibernateException { int oldSize = event.getSession().getActionQueue().numberOfCollectionRemovals(); try { flushEverythingToExecutions(event); boolean wasNeeded = event.getSession().getActionQueue().hasAnyQueuedActions(); if ( wasNeeded ) LOG.debug( "Session dirty" ); else LOG.debug( "Session not dirty" ); event.setDirty( wasNeeded ); } finally { event.getSession().getActionQueue().clearFromFlushNeededCheck( oldSize ); } } }
/** * Handle the given dirty-check event. * * @param event The dirty-check event to be handled. * @throws HibernateException */ public void onDirtyCheck(DirtyCheckEvent event) throws HibernateException { int oldSize = event.getSession().getActionQueue().numberOfCollectionRemovals(); try { flushEverythingToExecutions(event); boolean wasNeeded = event.getSession().getActionQueue().hasAnyQueuedActions(); if ( wasNeeded ) { LOG.debug( "Session dirty" ); } else { LOG.debug( "Session not dirty" ); } event.setDirty( wasNeeded ); } finally { event.getSession().getActionQueue().clearFromFlushNeededCheck( oldSize ); } } }
/** * Handle the given auto-flush event. * * @param event * The auto-flush event to be handled. * @throws HibernateException */ public void onAutoFlush(AutoFlushEvent event) throws HibernateException { final EventSource source = event.getSession(); if ( flushMightBeNeeded(source) ) { flushEverythingToExecutions(event); if ( flushIsReallyNeeded(event, source) ) { LOG.trace( "Need to execute flush" ); performExecutions(source); postFlush(source); // note: performExecutions() clears all collectionXxxxtion // collections (the collection actions) in the session if ( source.getFactory().getStatistics().isStatisticsEnabled() ) { source.getFactory().getStatisticsImplementor().flush(); } } else { LOG.trace( "Don't need to execute flush" ); final int oldSize = source.getActionQueue().numberOfCollectionRemovals(); source.getActionQueue().clearFromFlushNeededCheck( oldSize ); } event.setFlushRequired( flushIsReallyNeeded( event, source ) ); } }
/** * Handle the given auto-flush event. * * @param event * The auto-flush event to be handled. * @throws HibernateException */ public void onAutoFlush(AutoFlushEvent event) throws HibernateException { final EventSource source = event.getSession(); if ( flushMightBeNeeded(source) ) { flushEverythingToExecutions(event); if ( flushIsReallyNeeded(event, source) ) { LOG.trace( "Need to execute flush" ); performExecutions(source); postFlush(source); // note: performExecutions() clears all collectionXxxxtion // collections (the collection actions) in the session if ( source.getFactory().getStatistics().isStatisticsEnabled() ) { source.getFactory().getStatisticsImplementor().flush(); } } else { LOG.trace( "Don't need to execute flush" ); final int oldSize = source.getActionQueue().numberOfCollectionRemovals(); source.getActionQueue().clearFromFlushNeededCheck( oldSize ); } event.setFlushRequired( flushIsReallyNeeded( event, source ) ); } }
source.getActionQueue().clearFromFlushNeededCheck( oldSize );