FileDocCategorySizeDatePackage
DefaultDirtyCheckEventListener.javaAPI DocHibernate 3.2.51389Mon Aug 08 18:24:44 BST 2005org.hibernate.event.def

DefaultDirtyCheckEventListener

public class DefaultDirtyCheckEventListener extends AbstractFlushingEventListener implements org.hibernate.event.DirtyCheckEventListener
Defines the default dirty-check event listener used by hibernate for checking the session for dirtiness in response to generated dirty-check events.
author
Steve Ebersole

Fields Summary
private static final Log
log
Constructors Summary
Methods Summary
public voidonDirtyCheck(org.hibernate.event.DirtyCheckEvent event)
Handle the given dirty-check event.

param
event The dirty-check event to be handled.
throws
HibernateException


                        
	      

		int oldSize = event.getSession().getActionQueue().numberOfCollectionRemovals();

		try {
			flushEverythingToExecutions(event);
			boolean wasNeeded = event.getSession().getActionQueue().hasAnyQueuedActions();
			log.debug( wasNeeded ? "session dirty" : "session not dirty" );
			event.setDirty( wasNeeded );
		}
		finally {
			event.getSession().getActionQueue().clearFromFlushNeededCheck( oldSize );
		}