diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java index 16189e6278..244379182b 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java @@ -242,6 +242,7 @@ public final class SessionImpl private transient boolean discardOnClose; private transient TransactionObserver transactionObserver; + private transient EventListenerRegistry eventListenerRegistry; public SessionImpl(SessionFactoryImpl factory, SessionCreationOptions options) { super( factory, options ); @@ -678,7 +679,10 @@ public final class SessionImpl } private EventListenerGroup eventListenerGroup(EventType type) { - return getFactory().getServiceRegistry().getService( EventListenerRegistry.class ).getEventListenerGroup( type ); + if ( this.eventListenerRegistry == null ) { + this.eventListenerRegistry = getFactory().getServiceRegistry().getService( EventListenerRegistry.class ); + } + return eventListenerRegistry.getEventListenerGroup( type ); }