Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337398 - [Add a Query Column] Cannot modify resource set without a write transaction
Summary: [Add a Query Column] 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-02-17 03:35 EST by Vincent Lorenzo CLA
Modified: 2020-05-01 11:26 EDT (History)
2 users (show)

See Also:
gdupe: indigo+


Attachments
Patch Bug 337398 (3.32 KB, patch)
2011-03-03 08:15 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-02-17 03:35:25 EST
When I try to add a query column in the Papyrus Table Editor, I get the following 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.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:255)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:310)
	at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:307)
	at org.eclipse.emf.facet.widgets.nattable.TableLabelProvider.getColumnText(TableLabelProvider.java:176)
	at org.eclipse.emf.facet.widgets.nattable.painter.CustomizedCellPainter.convertDataType(CustomizedCellPainter.java:80)
	at org.eclipse.emf.facet.widgets.nattable.painter.CustomizedCellPainter.paintCell(CustomizedCellPainter.java:139)
	at net.sourceforge.nattable.painter.layer.CellLayerPainter.paintCell(CellLayerPainter.java:60)
	at net.sourceforge.nattable.selection.SelectionLayerPainter.paintCell(SelectionLayerPainter.java:123)
	at net.sourceforge.nattable.painter.layer.CellLayerPainter.paintLayer(CellLayerPainter.java:33)
	at net.sourceforge.nattable.painter.layer.GridLineCellLayerPainter.paintLayer(GridLineCellLayerPainter.java:16)
	at net.sourceforge.nattable.selection.SelectionLayerPainter.paintLayer(SelectionLayerPainter.java:34)
	at net.sourceforge.nattable.layer.CompositeLayer$CompositeLayerPainter.paintLayer(CompositeLayer.java:884)
	at net.sourceforge.nattable.NatTable$NatLayerPainter.paintLayer(NatTable.java:651)
	at net.sourceforge.nattable.NatTable.paintNatTable(NatTable.java:292)
	at net.sourceforge.nattable.NatTable.paintControl(NatTable.java:288)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:229)
	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.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1564)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4564)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4946)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2523)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3713)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2697)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2661)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2495)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	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:344)
	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:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Error while painting table: Cannot modify resource set without a write transaction
Comment 1 Nicolas Guyomar CLA 2011-03-03 08:15:28 EST
Created attachment 190258 [details]
Patch Bug 337398

Hi,

I've changed the query evaluation mechanism in the Table in order to fix this exception.

I've also removed the adapter which was added to the eObject because :
- It was not the responsibility of the concerned method to manage it.
- It was not the right behavior, the result of a query is not only modified if the eObject change, but also if the resource containing it changes.

(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 2 Gregoire Dupe CLA 2011-03-03 08:18:33 EST
Comment on attachment 190258 [details]
Patch Bug 337398


Here are a contribution from one employee of Mia-Software, targeting future
Indigo release. The company has signed a Member Commiter Agreement. The
contribution does not need a CQ (see bug 322327).

I've committed this contribution.

Committed revision 335.
Comment 3 Gregoire Dupe CLA 2011-03-03 08:19:30 EST
This bug can be marked as fixed.

Regards,
Gregoire
Comment 4 Vincent Lorenzo CLA 2011-03-11 07:24:05 EST
That works fine. I close the bug.