Revision c9285745
Added by Cherian Mathew almost 9 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java | ||
---|---|---|
25 | 25 |
import org.springframework.security.core.context.SecurityContext; |
26 | 26 |
import org.springframework.security.core.context.SecurityContextHolder; |
27 | 27 |
|
28 |
|
|
29 |
import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration; |
|
30 | 28 |
import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController; |
31 | 29 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration; |
32 | 30 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
... | ... | |
45 | 43 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
46 | 44 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
47 | 45 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
48 |
|
|
46 |
import eu.etaxonomy.taxeditor.remoting.cache.CdmRemoteCacheManager; |
|
49 | 47 |
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager; |
50 | 48 |
import eu.etaxonomy.taxeditor.session.mock.MockCdmEntitySessionManager; |
51 | 49 |
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin; |
... | ... | |
91 | 89 |
private ICdmSource cdmSource; |
92 | 90 |
|
93 | 91 |
private boolean isConnected; |
94 |
|
|
92 |
|
|
95 | 93 |
|
96 | 94 |
|
97 | 95 |
/** |
... | ... | |
120 | 118 |
|
121 | 119 |
ICdmSource cdmSource; |
122 | 120 |
try { |
121 |
|
|
123 | 122 |
cdmSource = CdmDataSourceRepository.getCurrentCdmSource(); |
124 | 123 |
connect(cdmSource); |
125 | 124 |
} catch (Exception e) { |
... | ... | |
150 | 149 |
private static void connect(final ICdmSource cdmSource, |
151 | 150 |
final DbSchemaValidation dbSchemaValidation, |
152 | 151 |
final Resource applicationContextBean) { |
152 |
if(isActive()) { |
|
153 |
// before we connect we clear the caches and the sessions |
|
154 |
CdmRemoteCacheManager.getInstance().getDefaultCacheManager().removalAll(); |
|
155 |
if(getCurrentSessionManager() != null) { |
|
156 |
getCurrentSessionManager().disposeAll(); |
|
157 |
} |
|
158 |
} |
|
153 | 159 |
MessagingUtils.info("Connecting to datasource: " + cdmSource); |
154 | 160 |
|
155 | 161 |
job = new CdmStoreConnector(Display.getDefault(), cdmSource, |
... | ... | |
256 | 262 |
} |
257 | 263 |
return conversation; |
258 | 264 |
} |
259 |
|
|
265 |
|
|
260 | 266 |
//FIXME:Remoting should be removed after moving completely to remoting |
261 | 267 |
private MockCdmEntitySessionManager mockCdmEntitySessionManager; |
262 |
|
|
268 |
|
|
263 | 269 |
private ICdmEntitySessionManager getSessionManager() { |
264 | 270 |
//FIXME:Remoting we should only have CdmApplicationRemoteConfiguration after move to remoting |
265 | 271 |
// bad hack which should be finally removed |
... | ... | |
269 | 275 |
if(mockCdmEntitySessionManager == null) { |
270 | 276 |
mockCdmEntitySessionManager = new MockCdmEntitySessionManager(); |
271 | 277 |
} |
272 |
return mockCdmEntitySessionManager;
|
|
278 |
return mockCdmEntitySessionManager; |
|
273 | 279 |
} |
274 | 280 |
} |
275 |
|
|
281 |
|
|
276 | 282 |
public static ICdmEntitySessionManager getCurrentSessionManager() { |
277 | 283 |
if (getDefault() != null) { |
278 | 284 |
return getDefault().getSessionManager(); |
Also available in: Unified diff
InspectSessionsDialog : added filtering
CdmStore : clearing caches and session before connecting
ParseHandler : using NonViralName instead of TaxonNameBase
AbstractPostTaxonOperation, AbstractPostOperation, AbstractPersistentPostOperation : added CdmEntitySessionEnabled object to constructor
NewTaxonNodeWizard : explicitly fire changes