Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335154 - Sort Column By Type : Cannot modify resource set without a write transaction
Summary: Sort Column By Type : Cannot modify resource set without a write transaction
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EMF-Facet (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Gregoire Dupe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-24 03:11 EST by Vincent Lorenzo CLA
Modified: 2020-05-01 11:26 EDT (History)
3 users (show)

See Also:
gdupe: indigo+


Attachments
Sort column with an EMF Command (106.94 KB, application/x-zip-compressed)
2011-01-24 07:51 EST, Nicolas Guyomar CLA
no flags Details
Patch on org.eclipse.emf.facet.widgets.nattable (1.29 KB, patch)
2011-02-16 09:52 EST, Nicolas Guyomar CLA
gdupe: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lorenzo CLA 2011-01-24 03:11:14 EST
With Papyrus, we get the following exception when we do the action "Sort Column By Type". 
This action should be done in a EMF Command. : 

Unhandled event loop exception

java.lang.IllegalStateException: Cannot modify resource set without a write transaction
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:348)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:302)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processObjectNotification(TransactionChangeRecorder.java:284)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:240)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
	at org.eclipse.emf.facet.widgets.nattable.instance.tableinstance.impl.TableInstanceImpl.setOnlyShowCommonColumns(TableInstanceImpl.java:452)
	at org.eclipse.emf.facet.widgets.nattable.NatTableWidget.setOnlyShowCommonColumns(NatTableWidget.java:1642)
	at org.eclipse.emf.facet.widgets.nattable.workbench.editor.NatTableEditor.setOnlyShowCommonColumns(NatTableEditor.java:205)
	at org.eclipse.emf.facet.widgets.nattable.workbench.editor.TableEditorToolBar$8.widgetSelected(TableEditorToolBar.java:203)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4084)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3675)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1409)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1385)
Comment 1 Nicolas Guyomar CLA 2011-01-24 07:51:00 EST
Created attachment 187416 [details]
Sort column with an EMF Command

Hi,

This action was modifying the model outside of an EMF command, please find attached the updated plug-ins :
 - org.eclipse.emf.facet.widgets.nattable
 - org.eclipse.emf.facet.widgets.nattable.workbench

Does this solve the problem ?

Regards

Nicolas Guyomar
Comment 2 Vincent Lorenzo CLA 2011-01-24 08:06:41 EST
Yes, it's solve the problem! Thank you!
Comment 3 Nicolas Guyomar CLA 2011-01-24 08:12:10 EST
Ok, I am going to do the same modifications for 335155 and 335156

Nicolas
Comment 4 Nicolas Guyomar CLA 2011-01-24 08:15:29 EST
Comment on attachment 187416 [details]
Sort column with an EMF Command

(a) I, Nicolas Guyomar, wrote 100% of the code I've provided.
(b) I have the right to contribute the code to Eclipse.
(c) I contribute the content under the EPL.

Regards
Nicolas Guyomar
Comment 5 Nicolas Guyomar CLA 2011-02-16 09:52:27 EST
Created attachment 189100 [details]
Patch on org.eclipse.emf.facet.widgets.nattable

Hi,

Here is a patch on revision 312 for an easiest integration

(a) I, Nicolas Guyomar, wrote 100% of the code of this patch.
(b) I have the right to contribute the code to Eclipse.
(c) I contribute the content under the EPL.


Regards,
Nicolas Guyomar
Comment 6 Gregoire Dupe CLA 2011-02-16 09:57:28 EST
Comment on attachment 189100 [details]
Patch on org.eclipse.emf.facet.widgets.nattable

This patch is smaller than 250 lines.

I've committed this patch.

Committed revision 313.
Comment 7 Gregoire Dupe CLA 2011-02-16 09:57:45 EST
This bug can be marked has fixed.
Comment 8 Vincent Lorenzo CLA 2011-02-24 09:26:06 EST
This bug can be closed.