Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324131 - Modifying the link on JPA diagram throws IllegalStateException: Cannot modify resource set without a write transaction
Summary: Modifying the link on JPA diagram throws IllegalStateException: Cannot modify...
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: Diagram Editor (show other bugs)
Version: 0.5   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.5 RC2   Edit
Assignee: Petya Sabeva CLA
QA Contact: Stefan Dimov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-31 16:28 EDT by Ram Venkataswamy CLA
Modified: 2011-01-17 08:22 EST (History)
0 users

See Also:


Attachments
patch (4.15 KB, patch)
2010-09-01 04:35 EDT, Petya Sabeva CLA
no flags Details | Diff
Disable MoveRelationFeature (6.33 KB, patch)
2010-09-09 04:33 EDT, Petya Sabeva CLA
no flags Details | Diff
Disable Move Feature (2.81 KB, patch)
2010-09-10 04:20 EDT, Petya Sabeva CLA
no flags Details | Diff
patch (1.83 KB, patch)
2010-09-14 06:22 EDT, Petya Sabeva CLA
stefan.dimov: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ram Venkataswamy CLA 2010-08-31 16:28:23 EDT
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)
Comment 1 Petya Sabeva CLA 2010-09-01 04:35:46 EDT
Created attachment 177921 [details]
patch
Comment 2 Stefan Dimov CLA 2010-09-08 03:50:18 EDT
(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 ...
Comment 3 Stefan Dimov CLA 2010-09-08 03:51:00 EDT
(In reply to comment #1)
> Created an attachment (id=177921) [details]
> patch

I still get the exception ...
Comment 4 Petya Sabeva CLA 2010-09-09 04:33:32 EDT
Created attachment 178489 [details]
Disable MoveRelationFeature

Because we do not support changing of the relations layout, this patch disables MoveRelationFeature at all.
Comment 5 Stefan Dimov CLA 2010-09-10 04:06:45 EDT
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.
Comment 6 Petya Sabeva CLA 2010-09-10 04:20:19 EDT
Created attachment 178588 [details]
Disable Move Feature

This patch disable the movement of the relation at all...
Comment 7 Stefan Dimov CLA 2010-09-10 08:51:51 EDT
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 ...
Comment 8 Petya Sabeva CLA 2010-09-14 06:22:00 EDT
Created attachment 178796 [details]
patch
Comment 9 Stefan Dimov CLA 2010-09-14 08:24:26 EDT
The patch is committed ...