Closing a session without a write transaction [message #1771904] |
Thu, 31 August 2017 21:10 |
Chris Mamorella Messages: 34 Registered: June 2013 |
Member |
|
|
I have tried closing a session using a CloseUISessionCommand but this doesn't reliably close the session. The only thing that seems to work is calling a close directly on the session (e.g. session->close), but this always generates the following IllegalStateException:
05:04:43:134 EDT at 31-Aug-2017 WARNING bundle:org.eclipse.sirius Thr:1 Error while unloading an unaccessible resource:
Cannot modify resource set without a write transaction
Caused by: java.lang.IllegalStateException: Cannot modify resource set without a write transaction
Cannot modify resource set without a write transaction
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:348)
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:302)
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processResourceNotification(TransactionChangeRecorder.java:272)
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:238)
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
org.eclipse.emf.common.notify.impl.NotifyingListImpl.dispatchNotification(NotifyingListImpl.java:261)
org.eclipse.emf.common.notify.impl.NotifyingListImpl.clear(NotifyingListImpl.java:1090)
org.eclipse.emf.ecore.resource.impl.ResourceImpl.doUnload(ResourceImpl.java:1641)
org.eclipse.emf.ecore.resource.impl.ResourceImpl.unload(ResourceImpl.java:1663)
org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.unloadAllResources(DAnalysisSessionImpl.java:1333)
org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.close(DAnalysisSessionImpl.java:1228)
It would be a great help if someone can explain the best practice as I haven't seen any standard documentation on this.
[Updated on: Thu, 31 August 2017 21:15] Report message to a moderator
|
|
|
Re: Closing a session without a write transaction [message #1771957 is a reply to message #1771904] |
Fri, 01 September 2017 14:05 |
|
Hello
Which version of Sirius do you use? I bet that will not reproduce with sirius5 because we don't unload the resource any more at close.
You said Quote:using a CloseUISessionCommand ... doesn't reliably close the session .
What do you mean? Could you detail what's wrong? This command will save the session if needed and close the opened editor and then close the session.
Nevertheless, this command is internal. Session.close() is the recommended way to close a session.
Do you have a reproducible scenario?
Regards
Laurent
Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.04003 seconds