DATACMNS-1547 - Properly remove partially populated PersistentEntity instances from cache.
We now remove partially populated PersistentEntity instances from the cache held in AbstractMappingContext as the creation could fail for other RuntimeExceptions other than a MappingException and we wouldn't want to keep the instances around in any case. Slight refactorings in the unit tests so that we can easily create MappingContext instances that reject certain types with certain exceptions.
This commit is contained in:
@@ -380,7 +380,7 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
|
||||
entity.setPersistentPropertyAccessorFactory(persistentPropertyAccessorFactory);
|
||||
}
|
||||
|
||||
} catch (MappingException e) {
|
||||
} catch (RuntimeException e) {
|
||||
persistentEntities.remove(typeInformation);
|
||||
throw e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user