Do not log deprecation warning from org.hibernate.ejb.HibernatePersistence#getProviderUtil
Description
See discussion on HHH-8625, but in general at the moment we log this deprecation warning from HibernatePersistence#getProviderUtil when HibernatePersistence may not be the provider actually being used.
The problem comes from the way JPA defines the behavior of javax.persistence.Persistence#isLoaded forcing it to ask all known providers whether the data is loaded (due to static, non-contextual calls).
The proposed solution is to simply log this deprecation warning on:
createEntityManagerFactory
createContainerEntityManagerFactory
generateSchema
(as well as on calls to internal getEntityManagerFactoryBuilderOrNull)
I am not sure that is totally kosher in cases where HibernatePersistence is in "shared ClassLoader" environments (app servers, e.g.).
And in non-"shared ClassLoader" environments I am not so sure how big of a deal this really is. You'd really have to be creating multiple EMFs within the same ClassLoader in such environments for this to mean anything.
FabriceFJanuary 6, 2014 at 12:47 AM
It would be nice to use a static flag to report this warning only once :
See discussion on HHH-8625, but in general at the moment we log this deprecation warning from
HibernatePersistence#getProviderUtil
when HibernatePersistence may not be the provider actually being used.The problem comes from the way JPA defines the behavior of
javax.persistence.Persistence#isLoaded
forcing it to ask all known providers whether the data is loaded (due to static, non-contextual calls).The proposed solution is to simply log this deprecation warning on:
createEntityManagerFactory
createContainerEntityManagerFactory
generateSchema
(as well as on calls to internal
getEntityManagerFactoryBuilderOrNull
)