[wildfly-dev] performance issue with wildfly and hibernate validator

Jason Greene jason.greene at redhat.com
Fri Sep 12 12:30:39 EDT 2014

On Sep 12, 2014, at 10:59 AM, Andrew Schmidt <Andrew.Schmidt at impactmobile.com> wrote:

> I've been investigating performance issues with wildfly and hibernate validator.  
> The changes made for this https://issues.jboss.org/browse/AS7-1306  imply the 
> follow from the jpa spec:
>  The results of calling the  PersistenceProviderResolverHolder.getPersistenceProviderResolver 
>  and the PersistenceProviderResolver.getPersistenceProviders methods must not be cached.
> however, the spec says later on:
>  Note that the PersistenceProviderResolver.getPersistenceProviders() method 
>  can potentially be called many times.  It is therefore recommended that the 
>  implementation of this method make use of caching.
> My interpretation is that wildfly should be caching the providers and it's the 
> responsibility of the callers to not cache the results.   So the issue AS7-1306 shouldn't 
> have been implemented.
> The performance penalty of wildfly not caching the implementation of that method in regards to 
> hibernate is that HibernatePersistenceProvider  uses a cache for classes/methods/fields 
> and that cache is blown away on every call to getPersistenceProviders and that 
> happens on every validation of every member of every class.

I agree with your interpretation. 

Jason T. Greene
WildFly Lead / JBoss EAP Platform Architect
JBoss, a division of Red Hat

More information about the wildfly-dev mailing list