Class JpaAutoFlushListener
java.lang.Object
org.hibernate.event.internal.AbstractFlushingEventListener
org.hibernate.event.internal.DefaultAutoFlushEventListener
org.keycloak.models.map.storage.jpa.hibernate.listeners.JpaAutoFlushListener
- All Implemented Interfaces:
org.hibernate.event.service.spi.JpaBootstrapSensitive
,org.hibernate.event.spi.AutoFlushEventListener
public class JpaAutoFlushListener
extends org.hibernate.event.internal.DefaultAutoFlushEventListener
Extends Hibernate's
DefaultAutoFlushEventListener
to always flush queued inserts to allow correct handling
of orphans of that entities in the same transactions, and also to clear a session-level query cache.
If they wouldn't be flushed, they won't be orphaned (at least not in Hibernate 5.3.24.Final).
This class copies over all functionality of the base class that can't be overwritten via inheritance.
This is being tracked as part of keycloak/keycloak#11666.
This also clears the JPA map store query level cache for the JpaMapStorage
whenever there is some data written to the database.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.hibernate.event.internal.AbstractFlushingEventListener
flushEverythingToExecutions, getCascadingAction, getContext, logFlushResults, performExecutions, postFlush, postPostFlush, wasJpaBootstrap
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
JpaAutoFlushListener
public JpaAutoFlushListener()
-
-
Method Details
-
onAutoFlush
public void onAutoFlush(org.hibernate.event.spi.AutoFlushEvent event) throws org.hibernate.HibernateException - Specified by:
onAutoFlush
in interfaceorg.hibernate.event.spi.AutoFlushEventListener
- Overrides:
onAutoFlush
in classorg.hibernate.event.internal.DefaultAutoFlushEventListener
- Throws:
org.hibernate.HibernateException
-