Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] java.lang.illegalStateException
[CDO] java.lang.illegalStateException [message #901607] Mon, 13 August 2012 16:14 Go to next message
Hassan BAZOUN is currently offline Hassan BAZOUN
Messages: 54
Registered: April 2012
Member
hi,

I'am trying to create a graphiti editor that uses CDO hibernate to store data and EObjects. the problem is that this exception is fired :

java.lang.IllegalStateException: Cannot modify resource set without a write transaction

at this function:

public void addNetUsers(List<NetUser> users) {
if (users.size() != 0) {
for (int i = 0; i < users.size(); i++) {
NetUser user = users.get(i);
//AT THIS POINT OF THE CODE
getResource().getContents().add(user);
try {
transaction.commit();
} catch (CommitException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

}

}


Do you have any idea why it is caused??


below is the whole 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.processResourceNotification(TransactionChangeRecorder.java:272)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:238)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1027)
at org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl.addUnique(DelegatingNotifyingListImpl.java:305)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:301)
at org.eclipse.emf.cdo.examples.hibernate.client.Service.addNetUsers(Service.java:133)
at org.eclipse.emf.cdo.examples.hibernate.client.Service.saveNetUsers(Service.java:183)
at org.eclipse.emf.cdo.examples.hibernate.client.GraphitiDiagramEditor.doSave(GraphitiDiagramEditor.java:32)
at org.eclipse.ui.internal.SaveableHelper$2.run(SaveableHelper.java:151)
at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:274)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindow.java:1666)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1663)
at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:282)
at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:261)
at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:156)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.doSave(CompatibilityPart.java:404)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:235)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:199)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:89)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.savePart(PartServiceImpl.java:1154)
at org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3459)
at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3477)
at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:76)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:210)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:276)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:494)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:545)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:366)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:313)
at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:82)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
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.Widget.sendKeyEvent(Widget.java:1104)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1521)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4640)
at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4528)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4976)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2546)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3756)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
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:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

thanks,
HB.
Re: [CDO] java.lang.illegalStateException [message #901618 is a reply to message #901607] Mon, 13 August 2012 16:31 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5522
Registered: July 2009
Senior Member
Hi Hasan,

I think https://bugs.eclipse.org/bugs/show_bug.cgi?id=323792 is related.

The classes Martin has written in
http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/transaction may
serve ideas, too.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Am 13.08.2012 18:14, schrieb Hassan BAZOUN:
> hi,
>
> I'am trying to create a graphiti editor that uses CDO hibernate to store data and EObjects. the problem is that this
> exception is fired :
>
> java.lang.IllegalStateException: Cannot modify resource set without a write transaction
>
> at this function:
>
> public void addNetUsers(List<NetUser> users) {
> if (users.size() != 0) {
> for (int i = 0; i < users.size(); i++) {
> NetUser user = users.get(i);
> //AT THIS POINT OF THE CODE
> getResource().getContents().add(user);
> try {
> transaction.commit();
> } catch (CommitException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
>
> }
>
> }
>
>
> Do you have any idea why it is caused??
>
>
> below is the whole 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.processResourceNotification(TransactionChangeRecorder.java:272)
> at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:238)
> at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
> at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1027)
> at org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl.addUnique(DelegatingNotifyingListImpl.java:305)
> at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:301)
> at org.eclipse.emf.cdo.examples.hibernate.client.Service.addNetUsers(Service.java:133)
> at org.eclipse.emf.cdo.examples.hibernate.client.Service.saveNetUsers(Service.java:183)
> at org.eclipse.emf.cdo.examples.hibernate.client.GraphitiDiagramEditor.doSave(GraphitiDiagramEditor.java:32)
> at org.eclipse.ui.internal.SaveableHelper$2.run(SaveableHelper.java:151)
> at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:274)
> at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
> at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
> at org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindow.java:1666)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
> at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1663)
> at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:282)
> at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:261)
> at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:156)
> at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.doSave(CompatibilityPart.java:404)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
> at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229)
> at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:235)
> at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:199)
> at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:89)
> at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.savePart(PartServiceImpl.java:1154)
> at org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3459)
> at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3477)
> at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:76)
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
> at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
> at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:76)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
> at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229)
> at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:210)
> at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
> at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171)
> at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:276)
> at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:494)
> at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:545)
> at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:366)
> at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:313)
> at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:82)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
> 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.Widget.sendKeyEvent(Widget.java:1104)
> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
> at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1521)
> at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4640)
> at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
> at org.eclipse.swt.widgets.Control.windowProc(Control.java:4528)
> at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4976)
> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2546)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3756)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
> at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
> at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
> 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:353)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
>
> thanks,
> HB.
Re: [CDO] java.lang.illegalStateException [message #901684 is a reply to message #901618] Tue, 14 August 2012 07:31 Go to previous message
Esteban Dugueperoux is currently offline Esteban Dugueperoux
Messages: 310
Registered: July 2009
Senior Member
Hi,

Seeing the stack, I don't believe that proposed solutions in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=323792 help you because a
ENotificationImpl will be sent instead of a CDODeltaNotifications. Then
to fix your exception, we must do your model changes in a EMF Command, a
RecordingCommand for exemple.

But you will get the same exception on other users when commiting on a
first one during invalidation because invalidation (remote changes
integration) is done outside EMF Transaction, which break the contract
of having model changes done in EMF Transaction, then
precommit/postcommit are not called.

The solution in
http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/transaction/DawnTransactionChangeRecorder.java
works for almost invalidation (remote changes integration) but not for
cross references removing (see
CDOTransactionImpl.removeCrossReferences()) which produces ENotifications.

If your read my comments in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=323792 , you can see that
I have proposed a change
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=363695 ) to have cross
references removing delegated to external class to be executed in a EMF
Command. You can also find in attachment of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=323792 a testcase showing
how to integrate remote changes in a EMF Transaction.

I'm doing lobbying to have my patch integrated :)

Best Regards.

On 13/08/2012 18:31, Eike Stepper wrote:
> Hi Hasan,
>
> I think https://bugs.eclipse.org/bugs/show_bug.cgi?id=323792 is related.
>
> The classes Martin has written in
> http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/transaction
> may serve ideas, too.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
> Am 13.08.2012 18:14, schrieb Hassan BAZOUN:
>> hi,
>>
>> I'am trying to create a graphiti editor that uses CDO hibernate to
>> store data and EObjects. the problem is that this exception is fired :
>>
>> java.lang.IllegalStateException: Cannot modify resource set without a
>> write transaction
>>
>> at this function:
>>
>> public void addNetUsers(List<NetUser> users) {
>> if (users.size() != 0) {
>> for (int i = 0; i < users.size(); i++) {
>> NetUser user = users.get(i);
>> //AT THIS POINT OF THE CODE
>> getResource().getContents().add(user);
>> try {
>> transaction.commit();
>> } catch (CommitException e) {
>> // TODO Auto-generated catch block
>> e.printStackTrace();
>> }
>> }
>>
>> }
>>
>> }
>>
>>
>> Do you have any idea why it is caused??
>>
>>
>> below is the whole 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.processResourceNotification(TransactionChangeRecorder.java:272)
>>
>> at
>> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:238)
>>
>> at
>> org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
>>
>> at
>> org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1027)
>>
>> at
>> org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl.addUnique(DelegatingNotifyingListImpl.java:305)
>>
>> at
>> org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:301)
>> at
>> org.eclipse.emf.cdo.examples.hibernate.client.Service.addNetUsers(Service.java:133)
>>
>> at
>> org.eclipse.emf.cdo.examples.hibernate.client.Service.saveNetUsers(Service.java:183)
>>
>> at
>> org.eclipse.emf.cdo.examples.hibernate.client.GraphitiDiagramEditor.doSave(GraphitiDiagramEditor.java:32)
>>
>> at
>> org.eclipse.ui.internal.SaveableHelper$2.run(SaveableHelper.java:151)
>> at
>> org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:274)
>> at
>> org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
>>
>> at
>> org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
>> at
>> org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindow.java:1666)
>> at
>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
>> at
>> org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1663)
>> at
>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:282)
>>
>> at
>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:261)
>>
>> at
>> org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:156)
>> at
>> org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.doSave(CompatibilityPart.java:404)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>> at java.lang.reflect.Method.invoke(Method.java:601)
>> at
>> org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
>>
>> at
>> org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229)
>>
>> at
>> org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:235)
>>
>> at
>> org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:199)
>>
>> at
>> org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:89)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.PartServiceImpl.savePart(PartServiceImpl.java:1154)
>>
>> at
>> org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3459)
>>
>> at
>> org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3477)
>> at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:76)
>> at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
>> at
>> org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
>> at
>> org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:76)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>> at java.lang.reflect.Method.invoke(Method.java:601)
>> at
>> org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
>>
>> at
>> org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229)
>>
>> at
>> org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:210)
>>
>> at
>> org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
>>
>> at
>> org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171)
>>
>> at
>> org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:276)
>>
>> at
>> org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:494)
>>
>> at
>> org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:545)
>>
>> at
>> org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:366)
>>
>> at
>> org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:313)
>>
>> at
>> org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:82)
>>
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
>> at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
>> 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.Widget.sendKeyEvent(Widget.java:1104)
>> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
>> at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1521)
>> at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4640)
>> at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
>> at org.eclipse.swt.widgets.Control.windowProc(Control.java:4528)
>> at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
>> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4976)
>> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
>> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2546)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3756)
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
>>
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
>>
>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>>
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
>>
>> at
>> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
>> at
>> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
>>
>> 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:353)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>> at java.lang.reflect.Method.invoke(Method.java:601)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
>>
>> thanks,
>> HB.
>
Previous Topic:[EMF] [EMF-Databinding] Error to observe changes in Undo Command over TableViewer
Next Topic:[CDO] DBStoreAccessor, SmartPreparedStatementCache
Goto Forum:
  


Current Time: Tue Sep 16 11:28:20 GMT 2014

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

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