Community
Participate
Working Groups
Build Identifier: M20100818-0800 Modifying the link on JPA diagram throws IllegalStateException: Cannot modify resource set without a write transaction Reproducible: Always Steps to Reproduce: - open a JPA diagram displaying entities - on the editor, click on any link (between two entities) - once the link is highlighted/selected modify the link path (Ex: using mouse click hold and drag the link) Below exception is recorded in the log file: - Close & re-open JPA diagram editor The link path modification is not retained. 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.setUnique(NotifyingListImpl.java:1198) at org.eclipse.emf.common.util.AbstractEList.set(AbstractEList.java:272) at org.eclipse.graphiti.features.impl.DefaultMoveBendpointFeature.moveBendpoint(DefaultMoveBendpointFeature.java:43) at org.eclipse.graphiti.features.impl.DefaultMoveBendpointFeature.execute(DefaultMoveBendpointFeature.java:57) at org.eclipse.graphiti.internal.command.GenericFeatureCommandWithContext.execute(GenericFeatureCommandWithContext.java:64) at org.eclipse.graphiti.ui.internal.command.GefCommandWrapper.execute(GefCommandWrapper.java:51) at org.eclipse.gef.commands.CommandStack.execute(CommandStack.java:197) at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:426) at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:443) at org.eclipse.gef.tools.SimpleDragTracker.performDrag(SimpleDragTracker.java:229) at org.eclipse.gef.tools.SimpleDragTracker.handleButtonUp(SimpleDragTracker.java:130) at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1206) at org.eclipse.gef.tools.SelectionTool.mouseUp(SelectionTool.java:572) at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301) at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380) at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:213) 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:4066) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) 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:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Created attachment 177921 [details] patch
(In reply to comment #0) ... > - Close & re-open JPA diagram editor > > The link path modification is not retained. ... The JPA editor doesn't support changing of the relations layout. It's automatic. Perhaps we should think of some more flexible way of layouting ...
(In reply to comment #1) > Created an attachment (id=177921) [details] > patch I still get the exception ...
Created attachment 178489 [details] Disable MoveRelationFeature Because we do not support changing of the relations layout, this patch disables MoveRelationFeature at all.
I've committed the patch, although still when you select the relation you can use the bendpoints to change the relation layout. But now, when you deselect the relation its layout recovers the way it was and we see the exception no more. It would be better if the bendpoints disappear and the user is not able to change the layout at all. As a long term solution perhaps we have to think of various ways of layouting.
Created attachment 178588 [details] Disable Move Feature This patch disable the movement of the relation at all...
I've tried the patch with three entities and three relations between them and seems that after consequtive selection of one or another relation sometimes I can move some relation, sometimes - not. Seems that it happens on random principle ...
Created attachment 178796 [details] patch
The patch is committed ...