Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Closing a session without a write transaction(Always getting: )
Closing a session without a write transaction [message #1771904] Thu, 31 August 2017 21:10 Go to next message
Chris Mamorella is currently offline Chris MamorellaFriend
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 Go to previous messageGo to next message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 166
Registered: October 2014
Senior Member
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
Re: Closing a session without a write transaction [message #1771960 is a reply to message #1771957] Fri, 01 September 2017 14:47 Go to previous message
Chris Mamorella is currently offline Chris MamorellaFriend
Messages: 34
Registered: June 2013
Member
I'm using 3.1.1. Unfortunately we cannot move to a newer version for awhile.

I don't really have much to reproduce. Whenever I call session.close I get that error, and it sometimes propagates to a pop-up dialog which is even worse. I tried the CloseUISessionCommand but it seems like it doesn't always close the session when I check the logs (possibly because of the error that we're talking about).

I would just like to find a way to avoid seeing that error triggered... or if nothing else, to catch it more gracefully.
Previous Topic:Memory leaks in Sirius?
Next Topic:Automatically scroll to center diagram when element is selected
Goto Forum:
  


Current Time: Fri Apr 03 11:00:30 GMT 2020

Powered by FUDForum. Page generated in 0.05353 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top