org.hibernate.event.def
public class: DefaultAutoFlushEventListener [javadoc |
source]
java.lang.Object
org.hibernate.event.def.AbstractFlushingEventListener
org.hibernate.event.def.DefaultAutoFlushEventListener
All Implemented Interfaces:
AutoFlushEventListener, Serializable
Direct Known Subclasses:
EJB3AutoFlushEventListener
Defines the default flush event listeners used by hibernate for
flushing session state in response to generated auto-flush events.
| Method from org.hibernate.event.def.DefaultAutoFlushEventListener Summary: |
|---|
|
onAutoFlush |
| Method from org.hibernate.event.def.DefaultAutoFlushEventListener Detail: |
public void onAutoFlush(AutoFlushEvent event) throws HibernateException {
final EventSource source = event.getSession();
if ( flushMightBeNeeded(source) ) {
final int oldSize = source.getActionQueue().numberOfCollectionRemovals();
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("Dont need to execute flush");
source.getActionQueue().clearFromFlushNeededCheck( oldSize );
}
event.setFlushRequired( flushIsReallyNeeded( event, source ) );
}
}
Handle the given auto-flush event. |