use of org.hibernate.event.spi.AutoFlushEventListener in project hibernate-orm by hibernate.
the class SessionImpl method autoFlushIfRequired.
/**
* detect in-memory changes, determine if the changes are to tables
* named in the query and, if so, complete execution the flush
*/
protected boolean autoFlushIfRequired(Set querySpaces) throws HibernateException {
checkOpen();
if (!isTransactionInProgress()) {
// do not auto-flush while outside a transaction
return false;
}
AutoFlushEvent event = new AutoFlushEvent(querySpaces, this);
for (AutoFlushEventListener listener : listeners(EventType.AUTO_FLUSH)) {
listener.onAutoFlush(event);
}
return event.isFlushRequired();
}
Aggregations