diff --git a/core/src/main/java/org/hibernate/impl/FilterImpl.java b/core/src/main/java/org/hibernate/impl/FilterImpl.java index 8003bfb8c9..36adb11955 100644 --- a/core/src/main/java/org/hibernate/impl/FilterImpl.java +++ b/core/src/main/java/org/hibernate/impl/FilterImpl.java @@ -51,6 +51,7 @@ public class FilterImpl implements Filter, Serializable { void afterDeserialize(SessionFactoryImpl factory) { definition = factory.getFilterDefinition(filterName); + validate(); } /** diff --git a/core/src/main/java/org/hibernate/impl/SessionImpl.java b/core/src/main/java/org/hibernate/impl/SessionImpl.java index 446be01988..c01363dbf0 100644 --- a/core/src/main/java/org/hibernate/impl/SessionImpl.java +++ b/core/src/main/java/org/hibernate/impl/SessionImpl.java @@ -2152,14 +2152,12 @@ public final class SessionImpl extends AbstractSessionImpl // LoadQueryInfluencers.getEnabledFilters() tries to validate each enabled // filter, which will fail when called before FilterImpl.afterDeserialize( factory ); - // Instead lookup the filter by name, call FilterImpl.afterDeserialize( factory ), - // and then validate. + // Instead lookup the filter by name and then call FilterImpl.afterDeserialize( factory ). Iterator iter = loadQueryInfluencers.getEnabledFilterNames().iterator(); while ( iter.hasNext() ) { String filterName = ( String ) iter.next(); - FilterImpl filter = ( FilterImpl ) loadQueryInfluencers.getEnabledFilter( filterName ); - filter.afterDeserialize( factory ); - filter.validate(); + ( ( FilterImpl ) loadQueryInfluencers.getEnabledFilter( filterName ) ) + .afterDeserialize( factory ); } if ( isRootSession && childSessionsByEntityMode != null ) {