commit 02ec8d6b51cd25ba9f9a2f50a76983dcc704b324
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Sun Nov 12 23:02:11 2017 +0100

    ref #7059 ref #7046 using kindOfunit for TypeDesisgnations instead of DerivationEvent type and fixing save and LIE problems:
        - intoducing EntityCache to allow re-using previously loaded entities
        - CdmEntityCache implements EntityCache
        - ToOneRelatedEntityReloader to replace entities loaded by the LazySelect
        - SpecimenTypeDesignationWorkingsetEditorPresenter implements CachingPresenter so that EnityCache and
    ToOneRelatedEntityReloader can interact
        - completing init strategies in RegistrationWorkingSetService
        - SpecimenTypeDesignationWorkingsetEditorPresenter.saveBean reuses entities stored in entityCache
        - introducing SpecimenTypeDesignationWorkingSetService

diff --git a/src/main/java/eu/etaxonomy/cdm/addon/config/CdmVaadinConfiguration.java b/src/main/java/eu/etaxonomy/cdm/addon/config/CdmVaadinConfiguration.java
index 5b4d5351..e0f37334 100644
--- a/src/main/java/eu/etaxonomy/cdm/addon/config/CdmVaadinConfiguration.java
+++ b/src/main/java/eu/etaxonomy/cdm/addon/config/CdmVaadinConfiguration.java
@@ -68,6 +68,7 @@ import eu.etaxonomy.vaadin.ui.annotation.EnableVaadinSpringNavigation;
 @EnableVaadin   // this imports VaadinConfiguration
 @EnableVaadinSpringNavigation // activate the NavigationManagerBean
 @EnableAnnotationBasedAccessControl // enable annotation based per view access control
+// @EnableTransactionManagement(mode=AdviceMode.ASPECTJ) // has no effect here
 public class CdmVaadinConfiguration implements ApplicationContextAware  {
 
     /**
diff --git a/src/main/java/eu/etaxonomy/cdm/cache/CdmEntityCache.java b/src/main/java/eu/etaxonomy/cdm/cache/CdmEntityCache.java
new file mode 100644
index 00000000..d161e28f
--- /dev/null
+++ b/src/main/java/eu/etaxonomy/cdm/cache/CdmEntityCache.java
@@ -0,0 +1,286 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.cache;
+
+import java.beans.PropertyDescriptor;
+import java.io.PrintStream;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.log4j.Logger;
+import org.hibernate.Hibernate;
+import org.hibernate.collection.internal.AbstractPersistentCollection;
+import org.hibernate.envers.internal.entities.mapper.relation.lazy.proxy.CollectionProxy;
+import org.hibernate.envers.internal.entities.mapper.relation.lazy.proxy.MapProxy;
+import org.hibernate.envers.internal.entities.mapper.relation.lazy.proxy.SortedMapProxy;
+
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.dao.initializer.AbstractBeanInitializer;
+
+/**
+ * @author a.kohlbecker
+ * @since 08.11.2017
+ *
+ */
+public class CdmEntityCache implements EntityCache {
+
+
+    private final static Logger logger = Logger.getLogger(CdmEntityCache.class);
+
+    private static final String COPY_ENTITY = "!";
+
+    private CdmBase entity;
+
+    private Map<EntityKey, CdmBase> entityyMap = new HashMap<>();
+
+    private List<String> entityPathList = new ArrayList<>();
+
+    private Map<EntityKey, List<String>> entityPathsMap = new HashMap<>();
+
+    private Set<EntityKey> copyEntitiyKeys = new HashSet<>();
+
+    private Set<Object> objectsSeen = new HashSet<>();
+
+    public CdmEntityCache(CdmBase entity){
+        this.entity = entity;
+        update();
+    }
+
+    @Override
+    public boolean update() {
+
+        entityPathList.clear();
+        entityPathsMap.clear();
+        objectsSeen.clear();
+        copyEntitiyKeys.clear();
+
+        String propertyPath = "";
+
+        analyzeEntity(entity, propertyPath);
+
+        return copyEntitiyKeys.isEmpty();
+    }
+
+    /**
+     *
+     */
+    protected void analyzeEntity(CdmBase bean, String propertyPath) {
+
+        EntityKey entityKey = new EntityKey(bean);
+
+        propertyPath += "[" + entityKey;
+        String flags = "";
+        CdmBase mappedEntity = entityyMap.put(entityKey, bean);
+
+        if(mappedEntity != null && mappedEntity != bean) {
+            copyEntitiyKeys.add(entityKey);
+            flags += COPY_ENTITY + bean.hashCode();
+        }
+
+        flags = analyzeMore(bean, entityKey, flags, mappedEntity);
+
+        if(!flags.isEmpty()){
+            propertyPath += "(" + flags + ")";
+        }
+        propertyPath += "]";
+
+        logger.debug(propertyPath);
+
+        entityPathList.add(propertyPath);
+        if(!entityPathsMap.containsKey(entityKey)){
+            entityPathsMap.put(entityKey, new ArrayList<>());
+        }
+        entityPathsMap.get(entityKey).add(propertyPath);
+
+        if(!objectsSeen.add(bean)){
+            // avoid cycles, do not recurse into properties of objects that have been analyzed already
+            return;
+        }
+
+        Set<PropertyDescriptor> properties = AbstractBeanInitializer.getProperties(bean, null);
+        for(PropertyDescriptor prop : properties){
+
+            try {
+                Object propertyValue = PropertyUtils.getProperty(bean, prop.getName());
+
+                if(propertyValue == null){
+                    continue;
+                }
+
+                String propertyPathSuffix = "." + prop.getName();
+
+                if(Hibernate.isInitialized(propertyValue)) {
+
+                    if(CdmBase.class.isAssignableFrom(prop.getPropertyType())){
+                        analyzeEntity(HibernateProxyHelper.deproxy(propertyValue, CdmBase.class), propertyPath + propertyPathSuffix);
+                        continue;
+                    }
+
+                    Collection<CdmBase> collection = null;
+                    if(propertyValue instanceof AbstractPersistentCollection){
+                        if (propertyValue  instanceof Collection) {
+                            collection = (Collection<CdmBase>) propertyValue;
+                        } else if (propertyValue instanceof Map) {
+                            collection = ((Map<?,CdmBase>)propertyValue).values();
+                        } else {
+                            logger.error("unhandled subtype of AbstractPersistentCollection");
+                        }
+                    } else if (propertyValue instanceof CollectionProxy
+                                || propertyValue instanceof MapProxy<?, ?>
+                                || propertyValue instanceof SortedMapProxy<?, ?>){
+                            //hibernate envers collections
+                            collection = (Collection<CdmBase>)propertyValue;
+                    }
+
+                    if(collection != null){
+                        for(CdmBase collectionItem : collection){
+                            analyzeEntity(HibernateProxyHelper.deproxy(collectionItem, CdmBase.class), propertyPath + propertyPathSuffix);
+                        }
+                    } else {
+                        // logger.error("Unhandled property type " + propertyValue.getClass().getName());
+                    }
+                }
+
+            } catch (IllegalAccessException e) {
+                String message = "Illegal access on property " + prop;
+                logger.error(message);
+                throw new RuntimeException(message, e);
+            } catch (InvocationTargetException e) {
+                String message = "Cannot invoke property " + prop + " not found";
+                logger.error(message);
+                throw new RuntimeException(message, e);
+            } catch (NoSuchMethodException e) {
+                String message = "Property " + prop.getName() + " not found for class " + bean.getClass();
+                logger.error(message);
+            }
+
+        }
+    }
+
+    /**
+     * Empty method which can be implemented by subclasses which do further analysis.
+     *
+     * @param bean
+     * @param entityKey
+     * @param flags
+     * @param mappedEntity
+     * @return
+     */
+    protected String analyzeMore(CdmBase bean, EntityKey entityKey, String flags, CdmBase mappedEntity) {
+        return flags;
+    }
+
+
+    public void printEntityGraph(PrintStream printStream){
+        printLegend(printStream);
+        for(String path : entityPathList) {
+            printStream.println(path);
+        }
+    }
+
+    public void printCopyEntities(PrintStream printStream){
+        printLegend(printStream);
+        for(EntityKey key : copyEntitiyKeys){
+            for(String path : entityPathsMap.get(key)) {
+                printStream.println(path);
+            }
+        }
+    }
+
+    /**
+     * @param printStream
+     */
+    protected void printLegend(PrintStream printStream) {
+        printStream.println(this.getClass().getSimpleName() + " legend: ");
+        printStream.println("    - '!{objectHash}': detected copy entity, followed by object hash");
+    }
+
+    public class EntityKey {
+
+        Class type;
+        int id;
+
+        public EntityKey(Class type, int id){
+            this.type = type;
+            this.id = id;
+        }
+
+        public EntityKey(CdmBase entity){
+            type = entity.getClass();
+            id = entity.getId();
+        }
+
+        /**
+         * @return the type
+         */
+        public Class getType() {
+            return type;
+        }
+
+        /**
+         * @return the id
+         */
+        public int getId() {
+            return id;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public int hashCode() {
+            return new HashCodeBuilder(15, 33)
+                    .append(type)
+                    .append(id)
+                    .toHashCode();
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            EntityKey other = (EntityKey)obj;
+            return this.id == other.id && this.type == other.type;
+
+        }
+
+        @Override
+        public String toString() {
+            return type.getSimpleName() + "#" + getId();
+        }
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public <CDM extends CdmBase> CDM find(CDM value) {
+        EntityKey entityKey = new EntityKey(HibernateProxyHelper.deproxy(value));
+        return (CDM) entityyMap.get(entityKey);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public <CDM extends CdmBase> CDM find(Class<CDM> type, int id) {
+        EntityKey entityKey = new EntityKey(type, id);
+        return (CDM) entityyMap.get(entityKey);
+    }
+
+
+}
diff --git a/src/main/java/eu/etaxonomy/cdm/cache/EntityCache.java b/src/main/java/eu/etaxonomy/cdm/cache/EntityCache.java
new file mode 100644
index 00000000..82212362
--- /dev/null
+++ b/src/main/java/eu/etaxonomy/cdm/cache/EntityCache.java
@@ -0,0 +1,36 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.cache;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author a.kohlbecker
+ * @since 09.11.2017
+ *
+ */
+public interface EntityCache {
+
+    /**
+     * @param value
+     * @return
+     */
+    public <CDM extends CdmBase> CDM find(CDM value);
+
+    public boolean update();
+
+    /**
+     * @param type
+     * @param id
+     * @return
+     */
+    public <CDM extends CdmBase> CDM find(Class<CDM> type, int id);
+
+
+}
diff --git a/src/main/java/eu/etaxonomy/cdm/dataInserter/RegistrationRequiredDataInserter.java b/src/main/java/eu/etaxonomy/cdm/dataInserter/RegistrationRequiredDataInserter.java
index d9f00016..e0e27f17 100644
--- a/src/main/java/eu/etaxonomy/cdm/dataInserter/RegistrationRequiredDataInserter.java
+++ b/src/main/java/eu/etaxonomy/cdm/dataInserter/RegistrationRequiredDataInserter.java
@@ -55,6 +55,17 @@ import eu.etaxonomy.cdm.vaadin.model.registration.KindOfUnitTerms;
 import eu.etaxonomy.cdm.vaadin.security.RolesAndPermissions;
 
 /**
+ *
+ * Can create missing registrations for names which have Extensions of the Type <code>IAPTRegdata.json</code>.
+ * See https://dev.e-taxonomy.eu/redmine/issues/6621 for further details.
+ * This feature can be activated by by supplying one of the following jvm command line arguments:
+ * <ul>
+ * <li><code>-DregistrationCreate=iapt</code>: create all iapt Registrations if missing</li>
+ * <li><code>-DregistrationWipeout=iapt</code>: remove all iapt Registrations</li>
+ * <li><code>-DregistrationWipeout=all</code>: remove all Registrations</li>
+ * </ul>
+ * The <code>-DregistrationWipeout</code> commands are executed before the <code>-DregistrationCreate</code> and will not change the name and type designations.
+ *
  * @author a.kohlbecker
  * @since May 9, 2017
  *
diff --git a/src/main/java/eu/etaxonomy/cdm/debug/PersistentContextAnalyzer.java b/src/main/java/eu/etaxonomy/cdm/debug/PersistentContextAnalyzer.java
new file mode 100644
index 00000000..fcb928ca
--- /dev/null
+++ b/src/main/java/eu/etaxonomy/cdm/debug/PersistentContextAnalyzer.java
@@ -0,0 +1,253 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.debug;
+
+import java.beans.PropertyDescriptor;
+import java.io.PrintStream;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.log4j.Logger;
+import org.hibernate.Hibernate;
+import org.hibernate.Session;
+import org.hibernate.collection.internal.AbstractPersistentCollection;
+import org.hibernate.envers.internal.entities.mapper.relation.lazy.proxy.CollectionProxy;
+import org.hibernate.envers.internal.entities.mapper.relation.lazy.proxy.MapProxy;
+import org.hibernate.envers.internal.entities.mapper.relation.lazy.proxy.SortedMapProxy;
+
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.dao.initializer.AbstractBeanInitializer;
+
+/**
+ * @author a.kohlbecker
+ * @since 08.11.2017
+ *
+ */
+public class PersistentContextAnalyzer {
+
+    /**
+     *
+     */
+    private static final String COPY_ENTITY = "!";
+
+    /**
+     *
+     */
+    private static final String IN_PERSITENT_CONTEXT = "*";
+
+    private final static Logger logger = Logger.getLogger(PersistentContextAnalyzer.class);
+
+    private Session session;
+
+    private CdmBase entity;
+
+    private Map<EntityKey, CdmBase> entityyMap = new HashMap<>();
+
+    private List<String> entityPathList = new ArrayList<>();
+
+    private Map<EntityKey, List<String>> entityPathsMap = new HashMap<>();
+
+    private Set<EntityKey> copyEntitiyKeys = new HashSet<>();
+
+    private Set<Object> objectsSeen = new HashSet<>();
+
+
+    public PersistentContextAnalyzer(CdmBase entity, Session session){
+        this.session = session;
+        this.entity = entity;
+        update();
+    }
+
+    public PersistentContextAnalyzer(CdmBase entity){
+        this(entity, null);
+    }
+
+    /**
+     * - find copied entities in the graph
+     */
+    private void update() {
+
+        String propertyPath = "";
+        analyzeEntity(entity, propertyPath);
+    }
+
+    public void printEntityGraph(PrintStream printStream){
+        printLegend(printStream);
+        for(String path : entityPathList) {
+            printStream.println(path);
+        }
+    }
+
+    public void printCopyEntities(PrintStream printStream){
+        printLegend(printStream);
+        for(EntityKey key : copyEntitiyKeys){
+            for(String path : entityPathsMap.get(key)) {
+                printStream.println(path);
+            }
+        }
+    }
+
+    /**
+     * @param printStream
+     */
+    protected void printLegend(PrintStream printStream) {
+        printStream.println("PersistentContextAnalyzer legend: ");
+        printStream.println("    - '*': entity mapped in persistent context");
+        printStream.println("    - '!{objectHash}': detected copy entity, followed by object hash");
+    }
+
+    /**
+     *
+     */
+    protected void analyzeEntity(CdmBase bean, String propertyPath) {
+
+        EntityKey entityKey = new EntityKey(bean);
+
+        propertyPath += "[" + entityKey;
+        String flags = "";
+        CdmBase mappedEntity = entityyMap.put(entityKey, bean);
+
+        if(session != null && session.contains(bean)){
+            flags += IN_PERSITENT_CONTEXT;
+        }
+        if(mappedEntity != null && mappedEntity != bean) {
+            copyEntitiyKeys.add(entityKey);
+            flags += COPY_ENTITY + bean.hashCode();
+        }
+        if(!flags.isEmpty()){
+            propertyPath += "(" + flags + ")";
+        }
+        propertyPath += "]";
+
+        logger.debug(propertyPath);
+
+        entityPathList.add(propertyPath);
+        if(!entityPathsMap.containsKey(entityKey)){
+            entityPathsMap.put(entityKey, new ArrayList<>());
+        }
+        entityPathsMap.get(entityKey).add(propertyPath);
+
+        if(!objectsSeen.add(bean)){
+            // avoid cycles, do not recurse into properties of objects that have been analyzed already
+            return;
+        }
+
+        Set<PropertyDescriptor> properties = AbstractBeanInitializer.getProperties(bean, null);
+        for(PropertyDescriptor prop : properties){
+
+            try {
+                Object propertyValue = PropertyUtils.getProperty(bean, prop.getName());
+
+                if(propertyValue == null){
+                    continue;
+                }
+
+                String propertyPathSuffix = "." + prop.getName();
+
+                if(Hibernate.isInitialized(propertyValue)) {
+
+                    if(CdmBase.class.isAssignableFrom(prop.getPropertyType())){
+                        analyzeEntity(HibernateProxyHelper.deproxy(propertyValue, CdmBase.class), propertyPath + propertyPathSuffix);
+                        continue;
+                    }
+
+                    Collection<CdmBase> collection = null;
+                    if(propertyValue instanceof AbstractPersistentCollection){
+                        if (propertyValue  instanceof Collection) {
+                            collection = (Collection<CdmBase>) propertyValue;
+                        } else if (propertyValue instanceof Map) {
+                            collection = ((Map<?,CdmBase>)propertyValue).values();
+                        } else {
+                            logger.error("unhandled subtype of AbstractPersistentCollection");
+                        }
+                    } else if (propertyValue instanceof CollectionProxy
+                                || propertyValue instanceof MapProxy<?, ?>
+                                || propertyValue instanceof SortedMapProxy<?, ?>){
+                            //hibernate envers collections
+                            collection = (Collection<CdmBase>)propertyValue;
+                    }
+
+                    if(collection != null){
+                        for(CdmBase collectionItem : collection){
+                            analyzeEntity(HibernateProxyHelper.deproxy(collectionItem, CdmBase.class), propertyPath + propertyPathSuffix);
+                        }
+                    } else {
+                        // logger.error("Unhandled property type " + propertyValue.getClass().getName());
+                    }
+                }
+
+            } catch (IllegalAccessException e) {
+                String message = "Illegal access on property " + prop;
+                logger.error(message);
+                throw new RuntimeException(message, e);
+            } catch (InvocationTargetException e) {
+                String message = "Cannot invoke property " + prop + " not found";
+                logger.error(message);
+                throw new RuntimeException(message, e);
+            } catch (NoSuchMethodException e) {
+                String message = "Property " + prop.getName() + " not found for class " + bean.getClass();
+                logger.error(message);
+            }
+
+        }
+    }
+
+    class EntityKey {
+
+        Class type;
+        int id;
+
+        public EntityKey(CdmBase entity){
+            type = entity.getClass();
+            id = entity.getId();
+        }
+
+        /**
+         * @return the type
+         */
+        public Class getType() {
+            return type;
+        }
+
+        /**
+         * @return the id
+         */
+        public int getId() {
+            return id;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public int hashCode() {
+            return new HashCodeBuilder(17, 31)
+                    .append(type)
+                    .append(id)
+                    .toHashCode();
+        }
+
+        @Override
+        public String toString() {
+            return type.getSimpleName() + "#" + getId();
+        }
+
+    }
+
+
+}
diff --git a/src/main/java/eu/etaxonomy/cdm/service/CdmStore.java b/src/main/java/eu/etaxonomy/cdm/service/CdmStore.java
index 460b3e00..4babd2e7 100644
--- a/src/main/java/eu/etaxonomy/cdm/service/CdmStore.java
+++ b/src/main/java/eu/etaxonomy/cdm/service/CdmStore.java
@@ -176,7 +176,7 @@ public class CdmStore<T extends CdmBase, S extends IService<T>> {
     /**
      *
      * @param bean
-
+     * 
      * @return the merged bean, this bean is <b>not reloaded</b> from the
      *         persistent storage.
      */
@@ -203,7 +203,7 @@ public class CdmStore<T extends CdmBase, S extends IService<T>> {
         // merge the changes into the session, ...
 
         T mergedBean = mergedBean(bean);
-        //T mergedBean = bean;
+
         // NOTE: saveOrUpdate is really needed here even if we to a merge before
         repo.getCommonService().saveOrUpdate(mergedBean);
         session.flush();
diff --git a/src/main/java/eu/etaxonomy/cdm/service/ISpecimenTypeDesignationWorkingSetService.java b/src/main/java/eu/etaxonomy/cdm/service/ISpecimenTypeDesignationWorkingSetService.java
new file mode 100644
index 00000000..ec6a8beb
--- /dev/null
+++ b/src/main/java/eu/etaxonomy/cdm/service/ISpecimenTypeDesignationWorkingSetService.java
@@ -0,0 +1,49 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.service;
+
+import eu.etaxonomy.cdm.model.common.VersionableEntity;
+import eu.etaxonomy.cdm.model.name.Registration;
+import eu.etaxonomy.cdm.model.name.TaxonName;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.vaadin.model.registration.SpecimenTypeDesignationWorkingSetDTO;
+
+/**
+ * @author a.kohlbecker
+ * @since May 4, 2017
+ *
+ */
+public interface ISpecimenTypeDesignationWorkingSetService {
+
+    public SpecimenTypeDesignationWorkingSetDTO<Registration> create(int registrationId, int publicationId, int typifiedNameId);
+
+    /**
+     * @param id the CDM Entity id
+     * @return
+     */
+    public SpecimenTypeDesignationWorkingSetDTO<Registration> loadDtoByIds(int registrationId, int workingsetId);
+
+    SpecimenTypeDesignationWorkingSetDTO<Registration> fixMissingFieldUnit(SpecimenTypeDesignationWorkingSetDTO<Registration> bean);
+
+
+    /**
+     * Saves the SpecimenTypeDesignationWorkingSetDTO and takes care for consistency in the working set:
+     * <ul>
+     *  <li>New TypeDesignations are associated with the OWNER.</li>
+     *  <li>The citation and typified name of newly created TypeDesignations are set to the supplied entities.</li>
+     *  <li>All type specimens are assured to be derivatives of the FieldUnit which is the base entity of the set.</li>
+     * </ul>
+     *
+     * @param dto the DTO to be persisted
+     * @param citation The Reference entity to be used for new TypeDesignations.
+     * @param typifiedName
+     */
+    void save(SpecimenTypeDesignationWorkingSetDTO<? extends VersionableEntity> dto,  Reference citation, TaxonName typifiedName);
+
+}
diff --git a/src/main/java/eu/etaxonomy/cdm/service/RegistrationWorkingSetService.java b/src/main/java/eu/etaxonomy/cdm/service/RegistrationWorkingSetService.java
index 6efca3f6..f7e91b89 100644
--- a/src/main/java/eu/etaxonomy/cdm/service/RegistrationWorkingSetService.java
+++ b/src/main/java/eu/etaxonomy/cdm/service/RegistrationWorkingSetService.java
@@ -40,16 +40,6 @@ import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationValidationException
 
 /**
  * Provides RegistrationDTOs and RegistrationWorkingsets for Registrations in the database.
- * <p>
- * Can create missing registrations for names which have Extensions of the Type <code>IAPTRegdata.json</code>.
- * See https://dev.e-taxonomy.eu/redmine/issues/6621 for further details.
- * This feature can be activated by by supplying one of the following jvm command line arguments:
- * <ul>
- * <li><code>-DregistrationCreate=iapt</code>: create all iapt Registrations if missing</li>
- * <li><code>-DregistrationWipeout=iapt</code>: remove all iapt Registrations</li>
- * <li><code>-DregistrationWipeout=all</code>: remove all Registrations</li>
- * </ul>
- * The <code>-DregistrationWipeout</code> commands are executed before the <code>-DregistrationCreate</code> and will not change the name and type designations.
  *
  *
  * @author a.kohlbecker
@@ -63,7 +53,7 @@ public class RegistrationWorkingSetService implements IRegistrationWorkingSetSer
     public static final List<String> REGISTRATION_INIT_STRATEGY = Arrays.asList(new String []{
             // typeDesignation
             "typeDesignations.typeStatus",
-            "typeDesignations.typifiedNames",
+            "typeDesignations.typifiedNames.typeDesignations", // important !!
             "typeDesignations.typeSpecimen",
             "typeDesignations.typeName",
             "typeDesignations.citation",
@@ -74,26 +64,16 @@ public class RegistrationWorkingSetService implements IRegistrationWorkingSetSer
             "name.nomenclaturalReference.inReference",
             "name.rank",
             "name.status.type",
+            "name.typeDesignations", // important !!"
             // institution
             "institution",
             }
     );
 
-    /**
-    *
-    */
-   private static final List<String> FIELDUNIT_INIT_STRATEGY = Arrays.asList(new String[]{
-           "$",
-           "gatheringEvent.$",
-           "gatheringEvent.country",
-           "gatheringEvent.collectingAreas",
-           "gatheringEvent.actor"
-   });
-
    /**
     *
     */
-   private static final List<String> DERIVEDUNIT_INIT_STRATEGY = Arrays.asList(new String[]{
+   private  List<String> DERIVEDUNIT_INIT_STRATEGY = Arrays.asList(new String[]{
            "collection",
            "storedUnder",
            "preservation",
@@ -103,9 +83,22 @@ public class RegistrationWorkingSetService implements IRegistrationWorkingSetSer
            "kindOfUnit",
            "derivedFrom.$",
            "derivedFrom.type",
-           "specimenTypeDesignations"
+           "derivedFrom.originals.derivationEvents", // important!!
+           "specimenTypeDesignations.typifiedNames.typeDesignations", // important!!
    });
 
+   /**
+   *
+   */
+  private List<String> FIELDUNIT_INIT_STRATEGY = Arrays.asList(new String[]{
+          "$",
+          "gatheringEvent.$",
+          "gatheringEvent.country",
+          "gatheringEvent.collectingAreas",
+          "gatheringEvent.actor",
+          "derivationEvents.derivatives" // important, otherwise the DerivedUnits are not included into the graph of initialized entities!!!
+  });
+
     /**
      *
      */
@@ -196,6 +189,7 @@ public class RegistrationWorkingSetService implements IRegistrationWorkingSetSer
      * @param reg
      */
     protected void inititializeSpecimen(Registration reg) {
+
         for(TypeDesignationBase<?> td : reg.getTypeDesignations()){
             if(td instanceof SpecimenTypeDesignation){
 
@@ -214,7 +208,6 @@ public class RegistrationWorkingSetService implements IRegistrationWorkingSetSer
                         }
                         if(sob instanceof FieldUnit){
                             defaultBeanInitializer.initialize(sob, FIELDUNIT_INIT_STRATEGY);
-                            int i = 0;
                         }
                     }
                     sobs = nextSobs;
diff --git a/src/main/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImpl.java b/src/main/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImpl.java
new file mode 100644
index 00000000..67e92903
--- /dev/null
+++ b/src/main/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImpl.java
@@ -0,0 +1,217 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.service;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.hibernate.Session;
+import org.jboss.logging.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import eu.etaxonomy.cdm.api.application.CdmRepository;
+import eu.etaxonomy.cdm.model.common.VersionableEntity;
+import eu.etaxonomy.cdm.model.name.Registration;
+import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
+import eu.etaxonomy.cdm.model.name.TaxonName;
+import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.vaadin.model.TypedEntityReference;
+import eu.etaxonomy.cdm.vaadin.model.registration.SpecimenTypeDesignationDTO;
+import eu.etaxonomy.cdm.vaadin.model.registration.SpecimenTypeDesignationWorkingSetDTO;
+import eu.etaxonomy.cdm.vaadin.util.converter.TypeDesignationSetManager.TypeDesignationWorkingSet;
+import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationDTO;
+
+/**
+ * @author a.kohlbecker
+ * @since Nov 13, 2017
+ *
+ */
+@Service("specimenTypeDesignationWorkingSetService")
+@Transactional(readOnly=true)
+public class SpecimenTypeDesignationWorkingSetServiceImpl implements ISpecimenTypeDesignationWorkingSetService {
+
+    private final Logger logger = Logger.getLogger(SpecimenTypeDesignationWorkingSetServiceImpl.class);
+
+    @Autowired
+    IRegistrationWorkingSetService registrationWorkingSetService;
+
+    @Qualifier("cdmRepository")
+    @Autowired
+    CdmRepository repo;
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public SpecimenTypeDesignationWorkingSetDTO<Registration> create(int registrationId, int publicationId, int typifiedNameId) {
+        FieldUnit newfieldUnit = FieldUnit.NewInstance();
+        Registration reg = repo.getRegistrationService().load(registrationId, RegistrationWorkingSetService.REGISTRATION_INIT_STRATEGY);
+        SpecimenTypeDesignationWorkingSetDTO<Registration> workingSetDto = new SpecimenTypeDesignationWorkingSetDTO<Registration>(reg, newfieldUnit, publicationId, typifiedNameId);
+        return workingSetDto;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @Transactional
+    public SpecimenTypeDesignationWorkingSetDTO<Registration> loadDtoByIds(int registrationId, int workingsetId) {
+        RegistrationDTO regDTO = registrationWorkingSetService.loadDtoById(registrationId);
+        // find the working set
+        TypeDesignationWorkingSet typeDesignationWorkingSet = regDTO.getTypeDesignationWorkingSet(workingsetId);
+        SpecimenTypeDesignationWorkingSetDTO<Registration> workingSetDto = regDTO.getSpecimenTypeDesignationWorkingSetDTO(typeDesignationWorkingSet.getBaseEntityReference());
+        workingSetDto.setCitationEntityID(regDTO.getCitation().getId());
+        workingSetDto.setTypifiedNameEntityID(regDTO.getTypifiedName().getId());
+        return workingSetDto;
+    }
+
+    @Override
+    public SpecimenTypeDesignationWorkingSetDTO<Registration> fixMissingFieldUnit(SpecimenTypeDesignationWorkingSetDTO<Registration> bean) {
+
+        if(bean.getFieldUnit() == null){
+            // in case the base unit of the working set is not a FieldUnit all contained TypeDesignations must be modified
+            // so that they are based on an empty FieldUnit with an associated Gathering Event
+
+            Registration reg = repo.getRegistrationService().find(bean.getOwner().getId());
+            RegistrationDTO regDTO = new RegistrationDTO(reg);
+
+            FieldUnit fieldUnit = FieldUnit.NewInstance();
+            GatheringEvent gatheringEvent = GatheringEvent.NewInstance();
+            fieldUnit.setGatheringEvent(gatheringEvent);
+            repo.getOccurrenceService().save(fieldUnit);
+
+            VersionableEntity baseEntity = bean.getBaseEntity();
+            Set<TypeDesignationBase> typeDesignations = regDTO.getTypeDesignationsInWorkingSet(
+                    new TypedEntityReference(baseEntity.getClass(), baseEntity.getId(), baseEntity.toString())
+                    );
+            for(TypeDesignationBase td : typeDesignations){
+                DerivationEvent de = DerivationEvent.NewInstance();//
+                de.addOriginal(fieldUnit);
+                de.addDerivative(((SpecimenTypeDesignation)td).getTypeSpecimen());
+                de.setType(DerivationEventType.GATHERING_IN_SITU());
+            }
+
+            repo.getRegistrationService().saveOrUpdate(reg);
+        }
+        return bean;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @Transactional(readOnly=false)
+    public void save(SpecimenTypeDesignationWorkingSetDTO<? extends VersionableEntity> dto, Reference citation, TaxonName typifiedName) {
+
+        if(dto.getOwner() instanceof Registration){
+            Registration regPremerge = (Registration) dto.getOwner();
+
+            // find the newly created type designations
+            Set<SpecimenTypeDesignation> newTypeDesignations = findNewTypeDesignations((SpecimenTypeDesignationWorkingSetDTO<Registration>) dto);
+
+            FieldUnit fieldUnit = (FieldUnit) dto.getBaseEntity();
+
+            // associate the new typeDesignations with the registration
+            for(SpecimenTypeDesignation std : newTypeDesignations){
+                assureFieldUnit(fieldUnit, std);
+                std.setCitation(citation);
+                typifiedName.addTypeDesignation(std, false);
+                regPremerge.addTypeDesignation(std);
+            }
+
+            for(SpecimenTypeDesignationDTO stdDTO : dto.getSpecimenTypeDesignationDTOs()){
+                SpecimenTypeDesignation specimenTypeDesignation = stdDTO.asSpecimenTypeDesignation();
+                // associate all type designations with the fieldUnit
+                assureFieldUnit(fieldUnit, specimenTypeDesignation);
+            }
+
+            Session session = repo.getSession();
+
+            session.merge(dto.getOwner());
+
+            session.flush();
+        }
+
+
+    }
+
+    /**
+     * @param session
+     * @param fieldUnit
+     * @param specimenTypeDesignation
+     */
+    protected void assureFieldUnit(FieldUnit fieldUnit,
+            SpecimenTypeDesignation specimenTypeDesignation) {
+        try {
+            SpecimenOrObservationBase<?> original = findEarliestOriginal(specimenTypeDesignation.getTypeSpecimen());
+            if(original instanceof DerivedUnit){
+                DerivedUnit du = (DerivedUnit)original;
+                du.getDerivedFrom().addOriginal(fieldUnit);
+            }
+        } catch (Exception e) {
+            // has more than one originals !!!
+            logger.error(e);
+        }
+    }
+
+    /**
+     * @param std
+     * @return
+     * @throws Exception
+     */
+    private SpecimenOrObservationBase<?> findEarliestOriginal(DerivedUnit du) throws Exception {
+
+        SpecimenOrObservationBase original = du;
+
+        while(du != null && du.getDerivedFrom() != null && !du.getDerivedFrom().getOriginals().isEmpty()) {
+            Iterator<SpecimenOrObservationBase> it = du.getDerivedFrom().getOriginals().iterator();
+            SpecimenOrObservationBase nextOriginal = it.next();
+            if(nextOriginal == null){
+                break;
+            }
+            original = nextOriginal;
+            if(original instanceof DerivedUnit){
+                du = (DerivedUnit)original;
+            } else {
+                // so this must be a FieldUnit,
+               break;
+            }
+            if(it.hasNext()){
+                throw new Exception(String.format("%s has more than one originals", du.toString()));
+            }
+        }
+        return original;
+    }
+
+    private Set<SpecimenTypeDesignation> findNewTypeDesignations(SpecimenTypeDesignationWorkingSetDTO<Registration> workingSetDto) {
+
+        Registration reg = workingSetDto.getOwner();
+        Set<SpecimenTypeDesignation> addCandidates = new HashSet<>();
+        for(SpecimenTypeDesignationDTO stdDTO : workingSetDto.getSpecimenTypeDesignationDTOs()){
+            SpecimenTypeDesignation std = stdDTO.asSpecimenTypeDesignation();
+            if(reg.getTypeDesignations().isEmpty() || !reg.getTypeDesignations().stream().filter(td -> td.equals(std)).findFirst().isPresent()){
+                addCandidates.add(std);
+            }
+        }
+        return addCandidates;
+    }
+
+}
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/event/ToOneRelatedEntityButtonUpdater.java b/src/main/java/eu/etaxonomy/cdm/vaadin/event/ToOneRelatedEntityButtonUpdater.java
index 381a2cf1..b875640a 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/event/ToOneRelatedEntityButtonUpdater.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/event/ToOneRelatedEntityButtonUpdater.java
@@ -27,8 +27,12 @@ public class ToOneRelatedEntityButtonUpdater<CDM extends CdmBase> implements Val
 
     ToOneRelatedEntityField<CDM>  toOneRelatedEntityField;
 
+    private Class<? extends CDM> type;
+
+
     public ToOneRelatedEntityButtonUpdater(ToOneRelatedEntityField<CDM> toOneRelatedEntityField){
         this.toOneRelatedEntityField = toOneRelatedEntityField;
+        this.type = toOneRelatedEntityField.getType();
     }
 
     /**
@@ -39,8 +43,8 @@ public class ToOneRelatedEntityButtonUpdater<CDM extends CdmBase> implements Val
 
         CdmBase value = (CdmBase)event.getProperty().getValue();
 
-        boolean userIsAllowedToUpdate = UserHelper.fromSession().userHasPermission(value, CRUD.UPDATE);
-        boolean userIsAllowedToCreate = UserHelper.fromSession().userHasPermission(value.getClass(), CRUD.CREATE);
+        boolean userIsAllowedToUpdate = value != null && UserHelper.fromSession().userHasPermission(value, CRUD.UPDATE);
+        boolean userIsAllowedToCreate = UserHelper.fromSession().userHasPermission(type, CRUD.CREATE);
 
         toOneRelatedEntityField.setAddButtonEnabled(userIsAllowedToCreate);
         toOneRelatedEntityField.setEditButtonEnabled(userIsAllowedToUpdate);
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/event/ToOneRelatedEntityReloader.java b/src/main/java/eu/etaxonomy/cdm/vaadin/event/ToOneRelatedEntityReloader.java
new file mode 100644
index 00000000..8fe15f7f
--- /dev/null
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/event/ToOneRelatedEntityReloader.java
@@ -0,0 +1,63 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.vaadin.event;
+
+import org.vaadin.viritin.fields.LazyComboBox;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+
+import eu.etaxonomy.cdm.cache.EntityCache;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.vaadin.view.name.CachingPresenter;
+
+/**
+ *
+ * @author a.kohlbecker
+ * @since 19.10.2017
+ *
+ */
+public class ToOneRelatedEntityReloader<CDM extends CdmBase> implements ValueChangeListener {
+
+    private static final long serialVersionUID = -1141764783149024788L;
+
+    LazyComboBox<CDM>  toOneRelatedEntityField;
+
+    CachingPresenter cachingPresenter;
+
+    public ToOneRelatedEntityReloader( LazyComboBox<CDM> toOneRelatedEntityField, CachingPresenter entityCache){
+        this.toOneRelatedEntityField = toOneRelatedEntityField;
+        this.cachingPresenter = entityCache;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void valueChange(ValueChangeEvent event) {
+
+        CDM value = (CDM)event.getProperty().getValue();
+        value = HibernateProxyHelper.deproxy(value);
+
+        EntityCache cache = cachingPresenter.getCache();
+        if(cache != null){
+            cache.update();
+            CDM cachedEntity = cache.find(value);
+            if(cachedEntity != null && cachedEntity != value){
+                toOneRelatedEntityField.removeValueChangeListener(this);
+                toOneRelatedEntityField.setValue(null); // reset to trick equals check in vaadin
+                toOneRelatedEntityField.setValue(cachedEntity);
+                toOneRelatedEntityField.addValueChangeListener(this);
+
+            }
+        }
+    }
+
+}
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/model/registration/SpecimenTypeDesignationWorkingSetDTO.java b/src/main/java/eu/etaxonomy/cdm/vaadin/model/registration/SpecimenTypeDesignationWorkingSetDTO.java
index bc9fb429..383c2038 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/model/registration/SpecimenTypeDesignationWorkingSetDTO.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/model/registration/SpecimenTypeDesignationWorkingSetDTO.java
@@ -29,7 +29,7 @@ import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
  * @since Jun 16, 2017
  *
  */
-public class SpecimenTypeDesignationWorkingSetDTO {
+public class SpecimenTypeDesignationWorkingSetDTO<OWNER extends VersionableEntity> {
 
     FieldUnit fieldUnit;
 
@@ -39,7 +39,11 @@ public class SpecimenTypeDesignationWorkingSetDTO {
 
     List<SpecimenTypeDesignationDTO> specimenTypeDesignationsDTOs = new ArrayList<>();
 
-    VersionableEntity owner;
+    OWNER owner;
+
+    private Integer citationEntityID;
+
+    private Integer typifiedNameEntityID;
 
     /**
      *
@@ -47,7 +51,7 @@ public class SpecimenTypeDesignationWorkingSetDTO {
      * @param baseEntity
      * @param specimenTypeDesignations can be <code>null</code>
      */
-    public SpecimenTypeDesignationWorkingSetDTO(VersionableEntity owner, VersionableEntity baseEntity, List<SpecimenTypeDesignation> specimenTypeDesignations) {
+    public SpecimenTypeDesignationWorkingSetDTO(OWNER owner, VersionableEntity baseEntity, List<SpecimenTypeDesignation> specimenTypeDesignations) {
         super();
         this.owner = owner;
         this.baseEntity = baseEntity;
@@ -63,6 +67,19 @@ public class SpecimenTypeDesignationWorkingSetDTO {
         }
     }
 
+    /**
+     * @param reg
+     * @param newfieldUnit
+     * @param citationEntityID
+     * @param typifiedNameEntityID
+     */
+    public SpecimenTypeDesignationWorkingSetDTO(OWNER reg, FieldUnit newfieldUnit, Integer citationEntityID,
+            Integer typifiedNameEntityID) {
+        this(reg, newfieldUnit, null);
+        this.citationEntityID = citationEntityID;
+        this.typifiedNameEntityID = typifiedNameEntityID;
+    }
+
     /**
      * @return the fieldUnit
      *      <code>null</code> if the base baseEntity is a not a fieldUnit
@@ -93,12 +110,12 @@ public class SpecimenTypeDesignationWorkingSetDTO {
     }
 
     /**
-     * The IdentifiableEntity which contains the DerivedUnit in this working set.
-     *
+     * The {@link VersionableEntity} which contains the DerivedUnit in this working set.
+     * This can be for example a {@link Registration} entity
      *
      * @return
      */
-    public VersionableEntity getOwner() {
+    public OWNER getOwner() {
         return owner;
     }
 
@@ -263,4 +280,34 @@ public class SpecimenTypeDesignationWorkingSetDTO {
         fieldUnit.getGatheringEvent().setGatheringDate(gatheringDate);
     }
 
+    /**
+     * @param id
+     */
+    public void setCitationEntityID(int id) {
+        citationEntityID = id;
+
+    }
+
+    /**
+     * @return
+     */
+    public int getCitationEntityID() {
+        return citationEntityID;
+    }
+
+    /**
+     * @param id
+     */
+    public void setTypifiedNameEntityID(int id) {
+        typifiedNameEntityID = id;
+
+    }
+
+    /**
+     * @return
+     */
+    public int getTypifiedNameEntityID() {
+        return typifiedNameEntityID;
+    }
+
 }
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/util/converter/TypeDesignationSetManager.java b/src/main/java/eu/etaxonomy/cdm/vaadin/util/converter/TypeDesignationSetManager.java
index bc08f5d8..c556ac87 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/util/converter/TypeDesignationSetManager.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/util/converter/TypeDesignationSetManager.java
@@ -21,6 +21,8 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
 
+import org.hibernate.search.hcore.util.impl.HibernateHelper;
+
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeCacheStrategy;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
@@ -189,7 +191,8 @@ public class TypeDesignationSetManager {
      * @return
      */
     protected TypedEntityReference<IdentifiableEntity<?>> makeEntityReference(IdentifiableEntity<?> baseEntity) {
-;
+
+        baseEntity = (IdentifiableEntity<?>) HibernateHelper.unproxy(baseEntity);
         String label = "";
         if(baseEntity  instanceof FieldUnit){
                 label = ((FieldUnit)baseEntity).getTitleCache();
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/CachingPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/CachingPresenter.java
new file mode 100644
index 00000000..a5a46a84
--- /dev/null
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/CachingPresenter.java
@@ -0,0 +1,22 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.vaadin.view.name;
+
+import eu.etaxonomy.cdm.cache.EntityCache;
+
+/**
+ * @author a.kohlbecker
+ * @since 09.11.2017
+ *
+ */
+public interface CachingPresenter {
+
+    public EntityCache getCache();
+
+}
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationDTORow.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationDTORow.java
index 085140f2..617cd2e1 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationDTORow.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationDTORow.java
@@ -42,7 +42,9 @@ public class SpecimenTypeDesignationDTORow {
 
     public SpecimenTypeDesignationDTORow(){
         kindOfUnit.setRows(1);
+        kindOfUnit.setRequired(true);
         typeStatus.setRows(1);
+        typeStatus.setRequired(true);
         accessionNumber.setWidth(100, Unit.PIXELS);
         collection.setWidth(150, Unit.PIXELS);
         mediaUri.setWidth(150, Unit.PIXELS);
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java
index ccfd44f1..4b0f7622 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java
@@ -9,49 +9,33 @@
 package eu.etaxonomy.cdm.vaadin.view.name;
 
 import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
 
-import org.hibernate.Session;
-import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.vaadin.viritin.fields.AbstractElementCollection;
 
 import eu.etaxonomy.cdm.api.service.IRegistrationService;
+import eu.etaxonomy.cdm.cache.CdmEntityCache;
+import eu.etaxonomy.cdm.cache.EntityCache;
 import eu.etaxonomy.cdm.model.common.DefinedTerm;
-import eu.etaxonomy.cdm.model.common.VersionableEntity;
 import eu.etaxonomy.cdm.model.location.Country;
 import eu.etaxonomy.cdm.model.name.Registration;
-import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
 import eu.etaxonomy.cdm.model.name.TaxonName;
-import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
 import eu.etaxonomy.cdm.model.occurrence.Collection;
-import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
-import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
-import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
 import eu.etaxonomy.cdm.service.CdmFilterablePagingProvider;
 import eu.etaxonomy.cdm.service.CdmStore;
-import eu.etaxonomy.cdm.service.IRegistrationWorkingSetService;
-import eu.etaxonomy.cdm.service.RegistrationWorkingSetService;
+import eu.etaxonomy.cdm.service.ISpecimenTypeDesignationWorkingSetService;
 import eu.etaxonomy.cdm.vaadin.component.CdmBeanItemContainerFactory;
 import eu.etaxonomy.cdm.vaadin.event.ToOneRelatedEntityButtonUpdater;
-import eu.etaxonomy.cdm.vaadin.model.TypedEntityReference;
+import eu.etaxonomy.cdm.vaadin.event.ToOneRelatedEntityReloader;
 import eu.etaxonomy.cdm.vaadin.model.registration.KindOfUnitTerms;
 import eu.etaxonomy.cdm.vaadin.model.registration.RegistrationTermLists;
-import eu.etaxonomy.cdm.vaadin.model.registration.SpecimenTypeDesignationDTO;
 import eu.etaxonomy.cdm.vaadin.model.registration.SpecimenTypeDesignationWorkingSetDTO;
 import eu.etaxonomy.cdm.vaadin.security.UserHelper;
 import eu.etaxonomy.cdm.vaadin.util.CdmTitleCacheCaptionGenerator;
-import eu.etaxonomy.cdm.vaadin.util.converter.TypeDesignationSetManager.TypeDesignationWorkingSet;
-import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationDTO;
 import eu.etaxonomy.vaadin.mvp.AbstractEditorPresenter;
-import eu.etaxonomy.vaadin.ui.view.PopupEditorFactory;
+import eu.etaxonomy.vaadin.mvp.AbstractPopupEditor;
 /**
  * SpecimenTypeDesignationWorkingsetPopupEditorView implementation must override the showInEditor() method,
  * see {@link #prepareAsFieldGroupDataSource()} for details.
@@ -61,22 +45,20 @@ import eu.etaxonomy.vaadin.ui.view.PopupEditorFactory;
  *
  */
 public class SpecimenTypeDesignationWorkingsetEditorPresenter
-    extends AbstractEditorPresenter<SpecimenTypeDesignationWorkingSetDTO , SpecimenTypeDesignationWorkingsetPopupEditorView> {
+    extends AbstractEditorPresenter<SpecimenTypeDesignationWorkingSetDTO , SpecimenTypeDesignationWorkingsetPopupEditorView>
+    implements CachingPresenter {
 
     private static final long serialVersionUID = 4255636253714476918L;
 
     CdmStore<Registration, IRegistrationService> store;
 
-    private Reference citation;
-
-    private TaxonName typifiedName;
 
     /**
      * This object for this field will either be injected by the {@link PopupEditorFactory} or by a Spring
      * {@link BeanFactory}
      */
     @Autowired
-    private IRegistrationWorkingSetService registrationWorkingSetService;
+    private ISpecimenTypeDesignationWorkingSetService specimenTypeDesignationWorkingSetService;
 
     /**
      * if not null, this CRUD set is to be used to create a CdmAuthoritiy for the base entitiy which will be
@@ -84,6 +66,8 @@ public class SpecimenTypeDesignationWorkingsetEditorPresenter
      */
     private EnumSet<CRUD> crud = null;
 
+    private CdmEntityCache cache = null;
+
     protected CdmStore<Registration, IRegistrationService> getStore() {
         if(store == null){
             store = new CdmStore<>(getRepo(), getRepo().getRegistrationService());
@@ -104,34 +88,32 @@ public class SpecimenTypeDesignationWorkingsetEditorPresenter
      * @param identifier a {@link TypeDesignationWorkingsetEditorIdSet}
      */
     @Override
-    protected SpecimenTypeDesignationWorkingSetDTO loadBeanById(Object identifier) {
+    protected SpecimenTypeDesignationWorkingSetDTO<Registration> loadBeanById(Object identifier) {
 
-        SpecimenTypeDesignationWorkingSetDTO workingSetDto;
+        SpecimenTypeDesignationWorkingSetDTO<Registration> workingSetDto;
         if(identifier != null){
 
             TypeDesignationWorkingsetEditorIdSet idset = (TypeDesignationWorkingsetEditorIdSet)identifier;
 
             if(idset.workingsetId != null){
-                RegistrationDTO regDTO = registrationWorkingSetService.loadDtoById(idset.registrationId);
-                // find the working set
-                TypeDesignationWorkingSet typeDesignationWorkingSet = regDTO.getTypeDesignationWorkingSet(idset.workingsetId);
-                workingSetDto = regDTO.getSpecimenTypeDesignationWorkingSetDTO(typeDesignationWorkingSet.getBaseEntityReference());
-                citation = (Reference) regDTO.getCitation();
-                workingSetDto = fixMissingFieldUnit(workingSetDto);
+                workingSetDto = specimenTypeDesignationWorkingSetService.loadDtoByIds(idset.registrationId, idset.workingsetId);
+                if(workingSetDto.getFieldUnit() == null){
+                    workingSetDto = specimenTypeDesignationWorkingSetService.fixMissingFieldUnit(workingSetDto);
+                        // FIXME open Dialog to warn user about adding an empty fieldUnit to the typeDesignations
+                        //       This method must go again into the presenter !!!!
+                        logger.info("Basing all typeDesignations on a new fieldUnit");
+                }
+                cache = new CdmEntityCache(workingSetDto.getOwner());
             } else {
                 // create a new workingset, for a new fieldunit which is the base for the workingset
-                FieldUnit newfieldUnit = FieldUnit.NewInstance();
-                Registration reg = getRepo().getRegistrationService().load(idset.registrationId,
-                        RegistrationWorkingSetService.REGISTRATION_INIT_STRATEGY);
-                //TODO checkif passing reg as owner parameter is needed at all
-                workingSetDto = new SpecimenTypeDesignationWorkingSetDTO(reg, newfieldUnit, null);
-                citation = getRepo().getReferenceService().find(idset.publicationId);
-                typifiedName = getRepo().getNameService().find(idset.typifiedNameId);
+                workingSetDto = specimenTypeDesignationWorkingSetService.create(idset.registrationId, idset.publicationId, idset.typifiedNameId);
+                cache = new CdmEntityCache(workingSetDto.getOwner());
             }
 
         } else {
             workingSetDto = null;
         }
+
         return workingSetDto;
     }
 
@@ -180,12 +162,14 @@ public class SpecimenTypeDesignationWorkingsetEditorPresenter
                         );
                 row.collection.getSelect().setCaptionGenerator(new CdmTitleCacheCaptionGenerator<Collection>());
                 row.collection.getSelect().addValueChangeListener(new ToOneRelatedEntityButtonUpdater<Collection>(row.collection));
+                row.collection.getSelect().addValueChangeListener(new ToOneRelatedEntityReloader<Collection>(row.collection.getSelect(), SpecimenTypeDesignationWorkingsetEditorPresenter.this));
 
                 row.mediaSpecimenReference.loadFrom(
                         referencePagingProvider,
                         referencePagingProvider,
                         collectionPagingProvider.getPageSize()
                         );
+
                 row.mediaSpecimenReference.getSelect().setCaptionGenerator(new CdmTitleCacheCaptionGenerator<Reference>());
                 row.mediaSpecimenReference.getSelect().addValueChangeListener(new ToOneRelatedEntityButtonUpdater<Reference>(row.mediaSpecimenReference));
 
@@ -212,88 +196,18 @@ public class SpecimenTypeDesignationWorkingsetEditorPresenter
     }
 
 
-    private SpecimenTypeDesignationWorkingSetDTO fixMissingFieldUnit(SpecimenTypeDesignationWorkingSetDTO bean) {
-
-        if(bean.getFieldUnit() == null){
-            // in case the base unit of the working set is not a FieldUnit all contained TypeDesignations must be modified
-            // so that they are based on an empty FieldUnit with an associated Gathering Event
-            if(Registration.class.isAssignableFrom(bean.getOwner().getClass())){
-                // FIXME open Dialog to warn user about adding an empty fieldUnit to the typeDesignations
-                logger.info("Basing all typeDesignations on a new fieldUnit");
-                Session session = getSession();
-                Registration reg = getRepo().getRegistrationService().find(bean.getOwner().getId());
-                RegistrationDTO regDTO = new RegistrationDTO(reg);
-
-                FieldUnit fieldUnit = FieldUnit.NewInstance();
-                GatheringEvent gatheringEvent = GatheringEvent.NewInstance();
-                fieldUnit.setGatheringEvent(gatheringEvent);
-                getRepo().getOccurrenceService().save(fieldUnit);
-
-                VersionableEntity baseEntity = bean.getBaseEntity();
-                Set<TypeDesignationBase> typeDesignations = regDTO.getTypeDesignationsInWorkingSet(
-                        new TypedEntityReference(baseEntity.getClass(), baseEntity.getId(), baseEntity.toString())
-                        );
-                for(TypeDesignationBase td : typeDesignations){
-                    DerivationEvent de = DerivationEvent.NewInstance();//
-                    de.addOriginal(fieldUnit);
-                    de.addDerivative(((SpecimenTypeDesignation)td).getTypeSpecimen());
-                    de.setType(DerivationEventType.GATHERING_IN_SITU());
-                }
-
-                getRepo().getRegistrationService().saveOrUpdate(reg);
-                session.flush();
-                session.close();
-            } else {
-                throw new RuntimeException("Usupported owner type " + bean.getOwner().getClass() + ", needs to be implemented.");
-            }
-        }
-        return bean;
-    }
-
-
-
     /**
      * {@inheritDoc}
      */
     @Override
     protected void saveBean(SpecimenTypeDesignationWorkingSetDTO dto) {
-
-        Registration reg = (Registration) dto.getOwner();
-
-        // associate all type designations with the fieldUnit
-        // 1. new ones are not yet associated
-        // 2. ones which had incomplete data are also not connected
-        for(SpecimenTypeDesignationDTO stdDTO : dto.getSpecimenTypeDesignationDTOs()){
-            try {
-                SpecimenOrObservationBase<?> original = findEarliestOriginal(stdDTO.asSpecimenTypeDesignation().getTypeSpecimen());
-                if(original instanceof DerivedUnit){
-                    DerivedUnit du = (DerivedUnit)original;
-                    du.getDerivedFrom().addOriginal(dto.getFieldUnit());
-                }
-            } catch (Exception e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-        }
-
-        // add newly added typeDesignations
-        Set<SpecimenTypeDesignation> addCandidates = new HashSet<>();
-        for(SpecimenTypeDesignationDTO stdDTO : dto.getSpecimenTypeDesignationDTOs()){
-            SpecimenTypeDesignation std = stdDTO.asSpecimenTypeDesignation();
-            if(reg.getTypeDesignations().isEmpty() || !reg.getTypeDesignations().stream().filter(td -> td.equals(std)).findFirst().isPresent()){
-                std.setCitation(citation);
-                typifiedName.addTypeDesignation(std, false);
-                addCandidates.add(std);
-            }
-        }
-        addCandidates.forEach(std -> reg.addTypeDesignation(std));
-
-
         if(crud != null){
             UserHelper.fromSession().createAuthorityForCurrentUser(dto.getFieldUnit(), crud, null);
         }
 
-        getStore().saveBean(reg);
+        Reference citation = cache.find(Reference.class, dto.getCitationEntityID());
+        TaxonName typifiedName =  cache.find(TaxonName.class, dto.getTypifiedNameEntityID());
+        specimenTypeDesignationWorkingSetService.save(dto, citation, typifiedName);
     }
 
     /**
@@ -305,43 +219,24 @@ public class SpecimenTypeDesignationWorkingsetEditorPresenter
 
     }
 
-
     /**
-     * @param std
-     * @return
-     * @throws Exception
+     * @param crud
      */
-    private SpecimenOrObservationBase<?> findEarliestOriginal(DerivedUnit du) throws Exception {
-
-        SpecimenOrObservationBase original = du;
+    public void setGrantsForCurrentUser(EnumSet<CRUD> crud) {
+        this.crud = crud;
 
-        while(du != null && du.getDerivedFrom() != null && !du.getDerivedFrom().getOriginals().isEmpty()) {
-            Iterator<SpecimenOrObservationBase> it = du.getDerivedFrom().getOriginals().iterator();
-            SpecimenOrObservationBase nextOriginal = it.next();
-            if(nextOriginal == null){
-                break;
-            }
-            original = nextOriginal;
-            if(original instanceof DerivedUnit){
-                du = (DerivedUnit)original;
-            } else {
-                // so this must be a FieldUnit,
-               break;
-            }
-            if(it.hasNext()){
-                throw new Exception(String.format("%s has more than one originals", du.toString()));
-            }
-        }
-        return original;
     }
 
-
     /**
-     * @param crud
+     * {@inheritDoc}
      */
-    public void setGrantsForCurrentUser(EnumSet<CRUD> crud) {
-        this.crud = crud;
-
+    @Override
+    public EntityCache getCache() {
+        if(((AbstractPopupEditor)getView()).isBeanLoaded()){
+            return cache;
+        } else {
+            return null;
+        }
     }
 
 
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetPopupEditor.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetPopupEditor.java
index 694ecfb3..57fad5f1 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetPopupEditor.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetPopupEditor.java
@@ -42,7 +42,6 @@ import eu.etaxonomy.vaadin.mvp.AbstractPopupEditor;
 public class SpecimenTypeDesignationWorkingsetPopupEditor
     extends AbstractPopupEditor<SpecimenTypeDesignationWorkingSetDTO, SpecimenTypeDesignationWorkingsetEditorPresenter>
     implements SpecimenTypeDesignationWorkingsetPopupEditorView, AccessRestrictedView, PerEntityAuthorityGrantingEditor {
-
     /**
      * @param layout
      * @param dtoType
@@ -54,8 +53,6 @@ public class SpecimenTypeDesignationWorkingsetPopupEditor
         grid.setSpacing(true);
     }
 
-
-
     private static final long serialVersionUID = 5418275817834009509L;
 
     private ListSelect countrySelectField;
@@ -155,6 +152,7 @@ public class SpecimenTypeDesignationWorkingsetPopupEditor
         // FIXME: can we use the Grid instead?
         typeDesignationsCollectionField = new ElementCollectionField<>(
                 SpecimenTypeDesignationDTO.class,
+                //getPresenter().specimenTypeDesignationDTOInstantiator(getBean());
                 SpecimenTypeDesignationDTORow.class
                 );
         typeDesignationsCollectionField.withCaption("Types");
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TypeDesignationWorkingsetEditorIdSet.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TypeDesignationWorkingsetEditorIdSet.java
index e11dde5b..92ae2ccc 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TypeDesignationWorkingsetEditorIdSet.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TypeDesignationWorkingsetEditorIdSet.java
@@ -9,6 +9,7 @@
 package eu.etaxonomy.cdm.vaadin.view.name;
 
 public class TypeDesignationWorkingsetEditorIdSet {
+
     Integer registrationId;
     Integer workingsetId;
     Integer publicationId;
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationDTO.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationDTO.java
index b73aeb11..e4bd66e5 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationDTO.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationDTO.java
@@ -285,12 +285,12 @@ public class RegistrationDTO{
         return typeDesignations;
     }
 
-    public SpecimenTypeDesignationWorkingSetDTO getSpecimenTypeDesignationWorkingSetDTO(TypedEntityReference baseEntityReference) {
+    public SpecimenTypeDesignationWorkingSetDTO<Registration> getSpecimenTypeDesignationWorkingSetDTO(TypedEntityReference baseEntityReference) {
         Set<TypeDesignationBase> typeDesignations = getTypeDesignationsInWorkingSet(baseEntityReference);
         List<SpecimenTypeDesignation> specimenTypeDesignations = new ArrayList<>(typeDesignations.size());
         typeDesignations.forEach(td -> specimenTypeDesignations.add((SpecimenTypeDesignation)td));
         IdentifiableEntity<?> baseEntity = getTypeDesignationWorkingSet(baseEntityReference).getBaseEntity();
-        SpecimenTypeDesignationWorkingSetDTO dto = new SpecimenTypeDesignationWorkingSetDTO(reg, baseEntity, specimenTypeDesignations);
+        SpecimenTypeDesignationWorkingSetDTO<Registration> dto = new SpecimenTypeDesignationWorkingSetDTO<Registration>(reg, baseEntity, specimenTypeDesignations);
         return dto;
     }
 
diff --git a/src/main/java/eu/etaxonomy/vaadin/component/ToOneRelatedEntityField.java b/src/main/java/eu/etaxonomy/vaadin/component/ToOneRelatedEntityField.java
index b113cce5..9d84a4c3 100644
--- a/src/main/java/eu/etaxonomy/vaadin/component/ToOneRelatedEntityField.java
+++ b/src/main/java/eu/etaxonomy/vaadin/component/ToOneRelatedEntityField.java
@@ -49,4 +49,6 @@ public interface ToOneRelatedEntityField<V extends Object> {
 
     public void selectNewItem(V bean);
 
+    public Class<? extends V> getType();
+
 }
diff --git a/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractCdmEditorPresenter.java b/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractCdmEditorPresenter.java
index 4128eedf..55201d9d 100644
--- a/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractCdmEditorPresenter.java
+++ b/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractCdmEditorPresenter.java
@@ -180,7 +180,8 @@ public abstract class AbstractCdmEditorPresenter<DTO extends CdmBase, V extends
     }
 
     @Override
-    protected final void saveBean(DTO bean){
+    protected
+    final void saveBean(DTO bean){
         // blank implementation, since this is not needed in this or any sub class
         // see onEditorSaveEvent() instead
     }
diff --git a/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractEditorPresenter.java b/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractEditorPresenter.java
index 6b526639..78e4adff 100644
--- a/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractEditorPresenter.java
+++ b/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractEditorPresenter.java
@@ -55,24 +55,29 @@ public abstract class AbstractEditorPresenter<DTO extends Object, V extends Appl
         if(!isFromOwnView(preSaveEvent)){
             return;
         }
-        getSession().setFlushMode(FlushMode.AUTO);
+//        getSession().setFlushMode(FlushMode.AUTO);
 
     }
 
-    /**
-     * Regarding changing the Flush mode see see also {@link ViewScopeConversationHolder}
-     *
-     * @param saveEvent
-     */
     @EventListener
     public void onEditorSaveEvent(EditorSaveEvent<DTO> saveEvent){
         if(!isFromOwnView(saveEvent)){
             return;
         }
         DTO bean = saveEvent.getBean();
-        saveBean(bean);
-        getSession().setFlushMode(previousPreSaveEvenFlushMode);
-        previousPreSaveEvenFlushMode = null;
+        try {
+            saveBean(bean);
+        } catch(Exception e){
+//            if(getSession().isOpen()){
+//                getSession().clear();
+//            }
+            throw e; // re-throw after cleaning up the session
+        } finally {
+//            if(getSession().isOpen()){
+//                getSession().setFlushMode(previousPreSaveEvenFlushMode);
+//            }
+//            previousPreSaveEvenFlushMode = null;
+        }
     }
 
     /**
diff --git a/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPopupEditor.java b/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPopupEditor.java
index 68ef11fb..2a6be0f3 100644
--- a/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPopupEditor.java
+++ b/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPopupEditor.java
@@ -85,6 +85,8 @@ public abstract class AbstractPopupEditor<DTO extends Object, P extends Abstract
 
     private GridLayout _gridLayoutCache;
 
+    private boolean isBeanLoaded;
+
     public AbstractPopupEditor(Layout layout, Class<DTO> dtoType) {
 
         mainLayout = new VerticalLayout();
@@ -535,6 +537,7 @@ public abstract class AbstractPopupEditor<DTO extends Object, P extends Abstract
         DTO beanToEdit = getPresenter().loadBeanById(identifier);
         fieldGroup.setItemDataSource(beanToEdit);
         afterItemDataSourceSet();
+        isBeanLoaded = true;
     }
 
     /**
@@ -546,6 +549,14 @@ public abstract class AbstractPopupEditor<DTO extends Object, P extends Abstract
         return fieldGroup.getItemDataSource().getBean();
     }
 
+    /**
+     * @return true once the bean has been loaded indicating that all fields have
+     *   been setup configured so that the editor is ready for use.
+     */
+    public boolean isBeanLoaded() {
+        return isBeanLoaded;
+    }
+
     /**
      * This method should only be used by the presenter of this view
      *
diff --git a/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPresenter.java b/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPresenter.java
index 7cd91be1..8ae3d9c7 100644
--- a/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPresenter.java
+++ b/src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPresenter.java
@@ -13,7 +13,6 @@ import org.springframework.security.core.context.SecurityContextHolder;
 
 import eu.etaxonomy.cdm.api.application.CdmRepository;
 import eu.etaxonomy.vaadin.ui.navigation.NavigationManager;
-import eu.etaxonomy.vaadin.ui.navigation.NavigationManagerBean;
 
 /**
  * AbstractPresenter is the base class of all presenter components. Presenter's
@@ -82,7 +81,13 @@ public abstract class AbstractPresenter<V extends ApplicationView> implements Se
      */
     protected Session getSession() {
         Session session = getRepo().getSession();
-        logger.trace(this._toString() + ".getSession() - session:" + session.hashCode() +", persistenceContext: " + ((SessionImplementor)session).getPersistenceContext() + " - " + session.toString());
+        if(logger.isTraceEnabled()){
+            if(session.isOpen()){
+                logger.trace(this._toString() + ".getSession() - session:" + session.hashCode() +", persistenceContext: " + ((SessionImplementor)session).getPersistenceContext() + " - " + session.toString());
+            }  else {
+                logger.trace(this._toString() + ".getSession() - session:" + session.hashCode() +"  is closed ");
+            }
+        }
         return session;
     }
 
diff --git a/src/main/java/eu/etaxonomy/vaadin/ui/view/PopupEditorFactory.java b/src/main/java/eu/etaxonomy/vaadin/ui/view/PopupEditorFactory.java
index efef6eea..34871060 100644
--- a/src/main/java/eu/etaxonomy/vaadin/ui/view/PopupEditorFactory.java
+++ b/src/main/java/eu/etaxonomy/vaadin/ui/view/PopupEditorFactory.java
@@ -27,7 +27,7 @@ import com.vaadin.spring.annotation.SpringComponent;
 import com.vaadin.spring.annotation.UIScope;
 
 import eu.etaxonomy.cdm.api.application.CdmRepository;
-import eu.etaxonomy.cdm.service.IRegistrationWorkingSetService;
+import eu.etaxonomy.cdm.service.ISpecimenTypeDesignationWorkingSetService;
 import eu.etaxonomy.cdm.vaadin.view.name.SpecimenTypeDesignationWorkingsetEditorPresenter;
 import eu.etaxonomy.vaadin.mvp.AbstractEditorPresenter;
 import eu.etaxonomy.vaadin.mvp.AbstractPopupEditor;
@@ -62,7 +62,7 @@ public class PopupEditorFactory {
     private PlatformTransactionManager transactionManager;
 
     @Autowired
-    private IRegistrationWorkingSetService registrationWorkingSetService;
+    private ISpecimenTypeDesignationWorkingSetService specimenTypeDesignationWorkingSetService;
 
     @Autowired
     @Lazy
@@ -73,7 +73,7 @@ public class PopupEditorFactory {
     private Field presenterEventBusField;
 
     private Field viewEventBusField;
-    private Field registrationWorkingSetServiceField;
+    private Field specimenTypeDesignationWorkingSetServiceField;
     private Method viewInjectPresenterMethod;
 
     private Method viewInitMethod;
@@ -107,8 +107,8 @@ public class PopupEditorFactory {
             viewInitMethod = AbstractView.class.getDeclaredMethod("init");
             viewInitMethod.setAccessible(true);
 
-            registrationWorkingSetServiceField = SpecimenTypeDesignationWorkingsetEditorPresenter.class.getDeclaredField("registrationWorkingSetService");
-            registrationWorkingSetServiceField.setAccessible(true);
+            specimenTypeDesignationWorkingSetServiceField = SpecimenTypeDesignationWorkingsetEditorPresenter.class.getDeclaredField("specimenTypeDesignationWorkingSetService");
+            specimenTypeDesignationWorkingSetServiceField.setAccessible(true);
 
         } catch (NoSuchFieldException | SecurityException | NoSuchMethodException  e) {
             throw new RuntimeException("Severe error during initialization. Please check the classes AbstractPresenter, AbstractEditorPresenter, AbstractView for modificactions.", e);
@@ -162,7 +162,7 @@ public class PopupEditorFactory {
             presenterEventBusField.set(presenter, eventBus);
         }
         if(SpecimenTypeDesignationWorkingsetEditorPresenter.class.equals(presenterClass)){
-            registrationWorkingSetServiceField.set(presenter, registrationWorkingSetService);
+            specimenTypeDesignationWorkingSetServiceField.set(presenter, specimenTypeDesignationWorkingSetService);
         }
     }
 
diff --git a/src/main/webapp/WEB-INF/applicationContext.xml b/src/main/webapp/WEB-INF/applicationContext.xml
index 6abc0166..08dab5dc 100644
--- a/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/src/main/webapp/WEB-INF/applicationContext.xml
@@ -49,7 +49,7 @@
     </bean>
 
     <!-- enable the configuration of transactional behavior based on annotations -->
-    <tx:annotation-driven transaction-manager="transactionManager" />
+    <tx:annotation-driven transaction-manager="transactionManager"/>
   	
   	<!-- import additional beans into the root context (this is in cdmlib-remote-webapp) -->
   	<!-- <import resource="applicationContext.views.xml" />  -->
diff --git a/src/test/java/eu/etaxonomy/cdm/cache/EntityCacheTest.java b/src/test/java/eu/etaxonomy/cdm/cache/EntityCacheTest.java
new file mode 100644
index 00000000..307d3228
--- /dev/null
+++ b/src/test/java/eu/etaxonomy/cdm/cache/EntityCacheTest.java
@@ -0,0 +1,46 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.cache;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import eu.etaxonomy.cdm.model.occurrence.Collection;
+
+/**
+ * @author a.kohlbecker
+ * @since 09.11.2017
+ *
+ */
+public class EntityCacheTest {
+
+    @Test
+    public void EntityKeyTest() {
+
+        Collection collection1 = Collection.NewInstance();
+        Collection collection2 = Collection.NewInstance();
+        collection1.setId(81);
+        collection2.setId(81);
+
+
+        CdmEntityCache cache = new CdmEntityCache(collection1);
+
+        CdmEntityCache.EntityKey key1 = cache.new EntityKey(collection1);
+
+        CdmEntityCache.EntityKey key2 = cache.new EntityKey(collection2);
+
+        Assert.assertEquals(key1, key2);
+
+        Assert.assertEquals(key1.hashCode(), key2.hashCode());
+
+        Assert.assertNotNull(cache.find(collection1));
+    }
+
+}
