From 6b58d5405787540ed984b61384374cb7c7d5c82e Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Thu, 22 Oct 2020 22:07:56 +0100 Subject: [PATCH] HHH-14293 Reset the ReflectionManager state after SessionFactory is initialized --- .../main/java/org/hibernate/internal/SessionFactoryImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java index be124c9443..bbaf51baae 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java @@ -392,6 +392,10 @@ public class SessionFactoryImpl implements SessionFactoryImplementor { this, serviceRegistry.getService( JndiService.class ) ); + + //As last operation, delete all caches from ReflectionManager + //(not modelled as a listener as we want this to be last) + metadata.getMetadataBuildingOptions().getReflectionManager().reset(); } catch (Exception e) { for ( Integrator integrator : serviceRegistry.getService( IntegratorService.class ).getIntegrators() ) {