HHH-7454 added DEBUG log message 'PersistenceUnitUtil#isLoaded is not always accurate; consider using EntityManager#contains instead'

This commit is contained in:
Scott Marlow 2012-07-18 10:59:42 -04:00
parent ccc58c50ae
commit b76e7c4987
1 changed files with 4 additions and 0 deletions

View File

@ -293,6 +293,8 @@ public class EntityManagerFactoryImpl implements HibernateEntityManagerFactory {
}
public boolean isLoaded(Object entity, String attributeName) {
// added log message to help with HHH-7454, if state == LoadState,NOT_LOADED, returning true or false is not accurate.
log.debug("PersistenceUnitUtil#isLoaded is not always accurate; consider using EntityManager#contains instead");
LoadState state = PersistenceUtilHelper.isLoadedWithoutReference( entity, attributeName, cache );
if (state == LoadState.LOADED) {
return true;
@ -306,6 +308,8 @@ public class EntityManagerFactoryImpl implements HibernateEntityManagerFactory {
}
public boolean isLoaded(Object entity) {
// added log message to help with HHH-7454, if state == LoadState,NOT_LOADED, returning true or false is not accurate.
log.debug("PersistenceUnitUtil#isLoaded is not always accurate; consider using EntityManager#contains instead");
return PersistenceUtilHelper.isLoaded( entity ) != LoadState.NOT_LOADED;
}