Project

General

Profile

« Previous | Next » 

Revision b5e66a5b

Added by Patrick Plitzner over 6 years ago

Fix session problems #5592

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java
87 87
	public void addPages() {
88 88

  
89 89
		CdmFormFactory formFactory = selectionElement.getFormFactory();
90
		CdmBase entity = (CdmBase) HibernateProxyHelper
90
		CdmBase entity = HibernateProxyHelper
91 91
				.deproxy(selectionElement.getEntity());
92 92
		//check if entity has already been persisted
93 93
		if(entity.getId()==0){
94 94
			rootElement = entity;
95
			cdmEntitySession.addNewCdmEntity(rootElement);
95 96
		}
96 97
		else{
97 98
			IService<CdmBase> service = CdmStore.getService(entity);
......
172 173
	@Override
173 174
	public boolean performFinish() {
174 175
	    IService<CdmBase> service = CdmStore.getService(rootElement);
175
	    service.merge(rootElement, true);
176
	    if(rootElement.getId()!=0){
177
	        service.merge(rootElement, true);
178
	    }
176 179
	    if(previousCdmEntitySession!=null){
177
	    	previousCdmEntitySession.load(rootElement, true);
180
	        selectionElement.setEntity(previousCdmEntitySession.load(rootElement, true));
178 181
	    }
179 182
		return true;
180 183
	}
......
201 204
            cdmEntitySession.dispose();
202 205
        }
203 206
        if(previousCdmEntitySession!=null){
204
            previousCdmEntitySession.bind();
207
            previousCdmEntitySession.dispose();
205 208
        }
206 209
    }
207 210

  

Also available in: Unified diff