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:
Serializable
,org.hibernate.event.service.spi.JpaBootstrapSensitive
,org.hibernate.event.spi.AutoFlushEventListener
public class JpaAutoFlushListener extends org.hibernate.event.internal.DefaultAutoFlushEventListener
Extends Hibernate'sDefaultAutoFlushEventListener
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 theJpaMapStorage
whenever there is some data written to the database.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static JpaAutoFlushListener
INSTANCE
-
Constructor Summary
Constructors Constructor Description JpaAutoFlushListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onAutoFlush(org.hibernate.event.spi.AutoFlushEvent event)
-
-
-
Field Detail
-
INSTANCE
public static final JpaAutoFlushListener INSTANCE
-
-
Method Detail
-
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
-
-