mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-10 21:24:49 +00:00
HHH-16565 Clear PC entry for 2LC inconsistent return class entities
This commit is contained in:
parent
3763686aff
commit
7c61867372
@ -317,12 +317,11 @@ private Object processCachedEntry(
|
||||
Object entity = convertCacheEntryToEntity( entry, entityKey.getIdentifier(), source, persister, instanceToLoad, entityKey );
|
||||
|
||||
if ( !persister.isInstance( entity ) ) {
|
||||
// Cleanup the inconsistent return class entity from the persistence context
|
||||
final PersistenceContext persistenceContext = source.getPersistenceContext();
|
||||
persistenceContext.removeEntry( entity );
|
||||
persistenceContext.removeEntity( entityKey );
|
||||
return null;
|
||||
// throw new WrongClassException(
|
||||
// "loaded object was of wrong class " + entity.getClass(),
|
||||
// entityKey.getIdentifier(),
|
||||
// persister.getEntityName()
|
||||
// );
|
||||
}
|
||||
|
||||
return entity;
|
||||
|
Loading…
x
Reference in New Issue
Block a user