Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Teneo and Gmf - Cannot modify resource set without a write transaction
Teneo and Gmf - Cannot modify resource set without a write transaction [message #492171] Mon, 19 October 2009 09:40 Go to next message
Eclipse UserFriend
Originally posted by: kretschmer.e-mundo.de

Hi newsgroup,

i am initializing my model and diagram similar to the example on
elver.org. I only changed the init method to always create and save a new
model. Then I return the URI of the root diagram initialized for this
model and try to open it.

The first time I invoke the 'new' action everything is working fine, as
the model is written to the Database and the Diagram opens with the model.
But the second time i invoke the action an exception is thrown: Cannot
modify resource set without a write transaction. The model is written to
database but the diagram does not show up.

Any clues why this happens and how i can resolve this?

gr. Philipp


org.eclipse.core.runtime.CoreException: Cannot modify resource set without
a write transaction
at
eu.emundo.atomspro.domain.diagram.part.DomainDocumentProvide r.setDocumentContent(DomainDocumentProvider.java:269)
at
eu.emundo.atomspro.domain.diagram.part.DomainDocumentProvide r.createDocument(DomainDocumentProvider.java:112)
at
eu.emundo.atomspro.domain.diagram.part.DomainDocumentProvide r.createElementInfo(DomainDocumentProvider.java:84)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider.connect(AbstractDocumentProvider.j ava:387)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.doSetInput(DiagramDocumentEditor.java:46 0)
at
eu.emundo.atomspro.domain.diagram.part.DomainDiagramEditor.s etInput(DomainDiagramEditor.java:304)
at org.eclipse.gef.ui.parts.GraphicalEditor.init(GraphicalEdito r.java:318)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.init( DiagramEditor.java:653)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.init(DiagramDocumentEditor.java:127)
at
org.eclipse.ui.internal.EditorManager.createSite(EditorManag er.java:798)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:644)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:462)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:595)
at
org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:286)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2857)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2762)
at
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2754)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2705)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2701)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2685)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
eu.emundo.atomspro.domain.diagram.commons.actions.dbeditor.N ewAtomsProApplicationDB.run(NewAtomsProApplicationDB.java:38 )
at
org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:251)
at
org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPl uginAction.java:229)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Caused by: java.lang.IllegalStateException: Cannot modify resource set
without a write transaction
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ssertWriting(TransactionChangeRecorder.java:348)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ppendNotification(TransactionChangeRecorder.java:302)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.p rocessResourceNotification(TransactionChangeRecorder.java:27 2)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.n otifyChanged(TransactionChangeRecorder.java:238)
at
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify (BasicNotifierImpl.java:280)
at
org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch (NotificationImpl.java:1033)
at
org.eclipse.emf.teneo.resource.StoreResource.addUsingContain mentStructure(StoreResource.java:344)
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResource.g etEObjectByID(HibernateResource.java:250)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:770)
at
eu.emundo.atomspro.domain.diagram.part.DomainDocumentProvide r.setDocumentContent(DomainDocumentProvider.java:246)
... 52 more
Re: Teneo and Gmf - Cannot modify resource set without a write transaction [message #492337 is a reply to message #492171] Tue, 20 October 2009 05:09 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Philipp,
I am not sure if it helps but this bugzilla contains a description of handling editing domains and GMF/Teneo/EMF:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=260940

Let me know if it solves the issue (I want to update the docs if it does).

Other links I found:
http://www.java-forum.org/plattformprogrammierung/89897-erro r-cannot-modify-resource-set-without-write-transaction.html
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg02117.html
http://wiki.eclipse.org/GMF_Archived_Newsgroup_Q_and_A#How_c an_I_modify_a_resource_set_without_a_write_transaction.3F

gr. Martin

Philipp Kretschmer wrote:
> Hi newsgroup,
>
> i am initializing my model and diagram similar to the example on
> elver.org. I only changed the init method to always create and save a
> new model. Then I return the URI of the root diagram initialized for
> this model and try to open it.
>
> The first time I invoke the 'new' action everything is working fine, as
> the model is written to the Database and the Diagram opens with the
> model. But the second time i invoke the action an exception is thrown:
> Cannot modify resource set without a write transaction. The model is
> written to database but the diagram does not show up.
>
> Any clues why this happens and how i can resolve this?
>
> gr. Philipp
>
>
> org.eclipse.core.runtime.CoreException: Cannot modify resource set
> without a write transaction
> at
> eu.emundo.atomspro.domain.diagram.part.DomainDocumentProvide r.setDocumentContent(DomainDocumentProvider.java:269)
>
> at
> eu.emundo.atomspro.domain.diagram.part.DomainDocumentProvide r.createDocument(DomainDocumentProvider.java:112)
>
> at
> eu.emundo.atomspro.domain.diagram.part.DomainDocumentProvide r.createElementInfo(DomainDocumentProvider.java:84)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider.connect(AbstractDocumentProvider.j ava:387)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.doSetInput(DiagramDocumentEditor.java:46 0)
>
> at
> eu.emundo.atomspro.domain.diagram.part.DomainDiagramEditor.s etInput(DomainDiagramEditor.java:304)
>
> at
> org.eclipse.gef.ui.parts.GraphicalEditor.init(GraphicalEdito r.java:318)
> at
> org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.init( DiagramEditor.java:653)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.init(DiagramDocumentEditor.java:127)
>
> at
> org.eclipse.ui.internal.EditorManager.createSite(EditorManag er.java:798)
> at
> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:644)
>
> at
> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:462)
>
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:595)
>
> at
> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:286)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2857)
>
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2762)
>
> at
> org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2754)
> at
> org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2705)
> at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2701)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2685)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
> at
> eu.emundo.atomspro.domain.diagram.commons.actions.dbeditor.N ewAtomsProApplicationDB.run(NewAtomsProApplicationDB.java:38 )
>
> at
> org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:251)
> at
> org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPl uginAction.java:229)
>
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
>
> at
> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
>
> at
> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
>
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
> Caused by: java.lang.IllegalStateException: Cannot modify resource set
> without a write transaction
> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ssertWriting(TransactionChangeRecorder.java:348)
>
> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ppendNotification(TransactionChangeRecorder.java:302)
>
> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.p rocessResourceNotification(TransactionChangeRecorder.java:27 2)
>
> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.n otifyChanged(TransactionChangeRecorder.java:238)
>
> at
> org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify (BasicNotifierImpl.java:280)
>
> at
> org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch (NotificationImpl.java:1033)
>
> at
> org.eclipse.emf.teneo.resource.StoreResource.addUsingContain mentStructure(StoreResource.java:344)
>
> at
> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.g etEObjectByID(HibernateResource.java:250)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:770)
>
> at
> eu.emundo.atomspro.domain.diagram.part.DomainDocumentProvide r.setDocumentContent(DomainDocumentProvider.java:246)
>
> ... 52 more


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:Possible to persist model to multiple files, or load from multiple files?
Next Topic:Multistatus reporting
Goto Forum:
  


Current Time: Thu Apr 25 11:04:49 GMT 2024

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

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

Back to the top