diff --git a/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java b/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java index 249d1e7fb..8bfdb675f 100644 --- a/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java +++ b/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2015 by the original author(s). + * Copyright 2011-2016 by the original author(s). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,6 +62,7 @@ import org.springframework.util.StringUtils; * @author Michael Hunger * @author Thomas Darimont * @author Tomasz Wysocki + * @author Mikael Klamra */ public abstract class AbstractMappingContext, P extends PersistentProperty

> implements MappingContext, ApplicationEventPublisherAware, InitializingBean { @@ -268,8 +269,8 @@ public abstract class AbstractMappingContext type) { @@ -278,14 +279,18 @@ public abstract class AbstractMappingContext typeInformation) { - + + Assert.notNull(typeInformation, "TypeInformation must not be null!"); + try { + read.lock(); + E persistentEntity = persistentEntities.get(typeInformation); if (persistentEntity != null) {