Project

General

Profile

« Previous | Next » 

Revision 02ec8d6b

Added by Andreas Kohlbecker over 6 years ago

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

View differences:

src/main/java/eu/etaxonomy/vaadin/mvp/AbstractEditorPresenter.java
55 55
        if(!isFromOwnView(preSaveEvent)){
56 56
            return;
57 57
        }
58
        getSession().setFlushMode(FlushMode.AUTO);
58
//        getSession().setFlushMode(FlushMode.AUTO);
59 59

  
60 60
    }
61 61

  
62
    /**
63
     * Regarding changing the Flush mode see see also {@link ViewScopeConversationHolder}
64
     *
65
     * @param saveEvent
66
     */
67 62
    @EventListener
68 63
    public void onEditorSaveEvent(EditorSaveEvent<DTO> saveEvent){
69 64
        if(!isFromOwnView(saveEvent)){
70 65
            return;
71 66
        }
72 67
        DTO bean = saveEvent.getBean();
73
        saveBean(bean);
74
        getSession().setFlushMode(previousPreSaveEvenFlushMode);
75
        previousPreSaveEvenFlushMode = null;
68
        try {
69
            saveBean(bean);
70
        } catch(Exception e){
71
//            if(getSession().isOpen()){
72
//                getSession().clear();
73
//            }
74
            throw e; // re-throw after cleaning up the session
75
        } finally {
76
//            if(getSession().isOpen()){
77
//                getSession().setFlushMode(previousPreSaveEvenFlushMode);
78
//            }
79
//            previousPreSaveEvenFlushMode = null;
80
        }
76 81
    }
77 82

  
78 83
    /**

Also available in: Unified diff