Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [TENEO] Illegal attempt to associate a collection with two open sessions
[TENEO] Illegal attempt to associate a collection with two open sessions [message #431252] Mon, 06 July 2009 10:34 Go to next message
Waldi  is currently offline Waldi Friend
Messages: 60
Registered: July 2009
Member
Hi,

I try to save a Person to a Group. (Pay attention i've change'd my model. I
attach my new Model.)

Leiter
Group 1 -----> N Person's

The following exception occur. I understand it, but i have no idea to avoid
it. I attach my new Model.

The Error occour if i try to save the main resource, after the association.
This command workes fine but p.save() throw the exception below.
Command cmd = AddCommand.create(p.getEditingDomain(), gruppe,
ZlvpPackage.Literals.GRUPPE__LEITER, person);
if (cmd.canExecute()) {
p.getEditingDomain().getCommandStack().execute(cmd);
}else{
System.out.println("Hat ned geklappt");
}

org.hibernate.HibernateException: Illegal attempt to associate a collection
with two open sessions
at
org.hibernate.collection.AbstractPersistentCollection.setCur rentSession(AbstractPersistentCollection.java:432)
at
org.hibernate.event.def.OnUpdateVisitor.processCollection(On UpdateVisitor.java:66)
at
org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:124)
at
org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:84)
at
org.hibernate.event.def.AbstractVisitor.processEntityPropert yValues(AbstractVisitor.java:78)
at
org.hibernate.event.def.AbstractVisitor.process(AbstractVisi tor.java:146)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:316)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:246)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:112)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:535)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :527)
at org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:241)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :240)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
at org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:320)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 266)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :243)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
at org.hibernate.engine.Cascade.cascade(Cascade.java:154)
at
org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:154)
at
org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:145)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:88)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:49)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at
org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:171)
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:375)
at
org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:405)
at
de.connection.service.teneo.TeneoLibraryPersistenceService.d oSave(TeneoLibraryPersistenceService.java:58)
at
de.connection.service.BaseLibraryPersistenceService.save(Bas eLibraryPersistenceService.java:104)
at de.gui.editor.AbstractEditor.doSave(AbstractEditor.java:40)
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.ja va:372)
at
org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:759)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:756)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2578)
at
org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:282)
at
org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:261)
at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelp er.java:156)
at org.eclipse.ui.internal.EditorManager.savePart(EditorManager .java:1357)
at org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage .java:3328)
at
org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPa ge.java:3341)
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(ActionHandl er.java:119)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at
org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at
org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:824)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:880)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:569)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:125)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:119 1)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040 )
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036 )
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946 )
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4589 )
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:24 09)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3471)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at de.gui.Application.start(Application.java:21)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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(EclipseS tarter.java:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
06.07.2009 11:26:40 org.eclipse.emf.teneo.TeneoException <init>
SCHWERWIEGEND: Exception when saving resource zlvp
org.hibernate.HibernateException: Illegal attempt to associate a collection
with two open sessions
at
org.hibernate.collection.AbstractPersistentCollection.setCur rentSession(AbstractPersistentCollection.java:432)
at
org.hibernate.event.def.OnUpdateVisitor.processCollection(On UpdateVisitor.java:66)
at
org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:124)
at
org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:84)
at
org.hibernate.event.def.AbstractVisitor.processEntityPropert yValues(AbstractVisitor.java:78)
at
org.hibernate.event.def.AbstractVisitor.process(AbstractVisi tor.java:146)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:316)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:246)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:112)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:535)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :527)
at org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:241)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :240)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
at org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:320)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 266)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :243)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
at org.hibernate.engine.Cascade.cascade(Cascade.java:154)
at
org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:154)
at
org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:145)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:88)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:49)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at
org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:171)
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:375)
at
org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:405)
at
de.connection.service.teneo.TeneoLibraryPersistenceService.d oSave(TeneoLibraryPersistenceService.java:58)
at
de.connection.service.BaseLibraryPersistenceService.save(Bas eLibraryPersistenceService.java:104)
at de.gui.editor.AbstractEditor.doSave(AbstractEditor.java:40)
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.ja va:372)
at
org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:759)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:756)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2578)
at
org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:282)
at
org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:261)
at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelp er.java:156)
at org.eclipse.ui.internal.EditorManager.savePart(EditorManager .java:1357)
at org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage .java:3328)
at
org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPa ge.java:3341)
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(ActionHandl er.java:119)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at
org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at
org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:824)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:880)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:569)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:125)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:119 1)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040 )
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036 )
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946 )
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4589 )
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:24 09)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3471)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at de.gui.Application.start(Application.java:21)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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(EclipseS tarter.java:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)



Re: [TENEO] Illegal attempt to associate a collection with two open sessions [message #431253 is a reply to message #431252] Mon, 06 July 2009 12:23 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Waldi,
As I remember it you read the person using one resource and then add it to a group in another resource, correct?
To prevent this exception both resources should use the same session. See here for more info:
http://www.elver.org/hibernate/hibernateresources.html#Shari ng+one+Session+between+Resources%2C+One+transaction+when+sav ing+multiple+resources

Let me know if this helps.

gr. Martin

Waldi wrote:
> Hi,
>
> I try to save a Person to a Group. (Pay attention i've change'd my model. I
> attach my new Model.)
>
> Leiter
> Group 1 -----> N Person's
>
> The following exception occur. I understand it, but i have no idea to avoid
> it. I attach my new Model.
>
> The Error occour if i try to save the main resource, after the association.
> This command workes fine but p.save() throw the exception below.
> Command cmd = AddCommand.create(p.getEditingDomain(), gruppe,
> ZlvpPackage.Literals.GRUPPE__LEITER, person);
> if (cmd.canExecute()) {
> p.getEditingDomain().getCommandStack().execute(cmd);
> }else{
> System.out.println("Hat ned geklappt");
> }
>
> org.hibernate.HibernateException: Illegal attempt to associate a collection
> with two open sessions
> at
> org.hibernate.collection.AbstractPersistentCollection.setCur rentSession(AbstractPersistentCollection.java:432)
> at
> org.hibernate.event.def.OnUpdateVisitor.processCollection(On UpdateVisitor.java:66)
> at
> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:124)
> at
> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:84)
> at
> org.hibernate.event.def.AbstractVisitor.processEntityPropert yValues(AbstractVisitor.java:78)
> at
> org.hibernate.event.def.AbstractVisitor.process(AbstractVisi tor.java:146)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:316)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:246)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:112)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:535)
> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :527)
> at org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:241)
> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :240)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
> at org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:320)
> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 266)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :243)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:154)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:154)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:145)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:88)
> at
> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:49)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:171)
> at
> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:375)
> at
> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:405)
> at
> de.connection.service.teneo.TeneoLibraryPersistenceService.d oSave(TeneoLibraryPersistenceService.java:58)
> at
> de.connection.service.BaseLibraryPersistenceService.save(Bas eLibraryPersistenceService.java:104)
> at de.gui.editor.AbstractEditor.doSave(AbstractEditor.java:40)
> 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.ja va:372)
> at
> org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:759)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at
> org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:756)
> at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2578)
> at
> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:282)
> at
> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:261)
> at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelp er.java:156)
> at org.eclipse.ui.internal.EditorManager.savePart(EditorManager .java:1357)
> at org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage .java:3328)
> at
> org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPa ge.java:3341)
> 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(ActionHandl er.java:119)
> at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
> at
> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
> at
> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:824)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:880)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:569)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:125)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Display.filterEvent(Display.java:119 1)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040 )
> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036 )
> at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
> at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
> at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946 )
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4589 )
> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:24 09)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3471)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at de.gui.Application.start(Application.java:21)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
> 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(EclipseS tarter.java:368)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
> 06.07.2009 11:26:40 org.eclipse.emf.teneo.TeneoException <init>
> SCHWERWIEGEND: Exception when saving resource zlvp
> org.hibernate.HibernateException: Illegal attempt to associate a collection
> with two open sessions
> at
> org.hibernate.collection.AbstractPersistentCollection.setCur rentSession(AbstractPersistentCollection.java:432)
> at
> org.hibernate.event.def.OnUpdateVisitor.processCollection(On UpdateVisitor.java:66)
> at
> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:124)
> at
> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:84)
> at
> org.hibernate.event.def.AbstractVisitor.processEntityPropert yValues(AbstractVisitor.java:78)
> at
> org.hibernate.event.def.AbstractVisitor.process(AbstractVisi tor.java:146)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:316)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:246)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:112)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:535)
> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :527)
> at org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:241)
> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :240)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
> at org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:320)
> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 266)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :243)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:154)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:154)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:145)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:88)
> at
> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:49)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:171)
> at
> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:375)
> at
> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:405)
> at
> de.connection.service.teneo.TeneoLibraryPersistenceService.d oSave(TeneoLibraryPersistenceService.java:58)
> at
> de.connection.service.BaseLibraryPersistenceService.save(Bas eLibraryPersistenceService.java:104)
> at de.gui.editor.AbstractEditor.doSave(AbstractEditor.java:40)
> 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.ja va:372)
> at
> org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:759)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at
> org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:756)
> at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2578)
> at
> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:282)
> at
> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:261)
> at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelp er.java:156)
> at org.eclipse.ui.internal.EditorManager.savePart(EditorManager .java:1357)
> at org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage .java:3328)
> at
> org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPa ge.java:3341)
> 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(ActionHandl er.java:119)
> at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
> at
> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
> at
> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:824)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:880)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:569)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:125)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Display.filterEvent(Display.java:119 1)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040 )
> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036 )
> at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
> at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
> at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946 )
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4589 )
> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:24 09)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3471)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at de.gui.Application.start(Application.java:21)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
> 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(EclipseS tarter.java:368)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [TENEO] Illegal attempt to associate a collection with two open sessions [message #431254 is a reply to message #431253] Mon, 06 July 2009 13:39 Go to previous messageGo to next message
Waldi  is currently offline Waldi Friend
Messages: 60
Registered: July 2009
Member
Ok, it run realy good. Thanks a lot. But if I associate a Gender or
something else with the Person I don't need them. Why?

"Martin Taal" <mtaal@elver.org> schrieb im Newsbeitrag
news:h2sqbq$hhd$1@build.eclipse.org...
> Hi Waldi,
> As I remember it you read the person using one resource and then add it to
> a group in another resource, correct?
> To prevent this exception both resources should use the same session. See
> here for more info:
> http://www.elver.org/hibernate/hibernateresources.html#Shari ng+one+Session+between+Resources%2C+One+transaction+when+sav ing+multiple+resources
>
> Let me know if this helps.
>
> gr. Martin
>
> Waldi wrote:
>> Hi,
>>
>> I try to save a Person to a Group. (Pay attention i've change'd my model.
>> I attach my new Model.)
>>
>> Leiter
>> Group 1 -----> N Person's
>>
>> The following exception occur. I understand it, but i have no idea to
>> avoid it. I attach my new Model.
>>
>> The Error occour if i try to save the main resource, after the
>> association. This command workes fine but p.save() throw the exception
>> below.
>> Command cmd = AddCommand.create(p.getEditingDomain(), gruppe,
>> ZlvpPackage.Literals.GRUPPE__LEITER, person);
>> if (cmd.canExecute()) {
>> p.getEditingDomain().getCommandStack().execute(cmd);
>> }else{
>> System.out.println("Hat ned geklappt");
>> }
>>
>> org.hibernate.HibernateException: Illegal attempt to associate a
>> collection with two open sessions
>> at
>> org.hibernate.collection.AbstractPersistentCollection.setCur rentSession(AbstractPersistentCollection.java:432)
>> at
>> org.hibernate.event.def.OnUpdateVisitor.processCollection(On UpdateVisitor.java:66)
>> at
>> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:124)
>> at
>> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:84)
>> at
>> org.hibernate.event.def.AbstractVisitor.processEntityPropert yValues(AbstractVisitor.java:78)
>> at
>> org.hibernate.event.def.AbstractVisitor.process(AbstractVisi tor.java:146)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:316)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:246)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:112)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:535)
>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :527)
>> at
>> org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:241)
>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292)
>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :240)
>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
>> at
>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:320)
>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 266)
>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :243)
>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
>> at org.hibernate.engine.Cascade.cascade(Cascade.java:154)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:154)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:145)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:88)
>> at
>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:49)
>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
>> at
>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:171)
>> at
>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:375)
>> at
>> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:405)
>> at
>> de.connection.service.teneo.TeneoLibraryPersistenceService.d oSave(TeneoLibraryPersistenceService.java:58)
>> at
>> de.connection.service.BaseLibraryPersistenceService.save(Bas eLibraryPersistenceService.java:104)
>> at de.gui.editor.AbstractEditor.doSave(AbstractEditor.java:40)
>> 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.ja va:372)
>> at
>> org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:759)
>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>> at
>> org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:756)
>> at
>> org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2578)
>> at
>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:282)
>> at
>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:261)
>> at
>> org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelp er.java:156)
>> at
>> org.eclipse.ui.internal.EditorManager.savePart(EditorManager .java:1357)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage .java:3328)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPa ge.java:3341)
>> 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(ActionHandl er.java:119)
>> at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
>> at
>> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
>> at
>> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:824)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:880)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:569)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:125)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>> at org.eclipse.swt.widgets.Display.filterEvent(Display.java:119 1)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
>> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040 )
>> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036 )
>> at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
>> at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
>> at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946 )
>> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4589 )
>> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
>> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:24 09)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3471)
>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>> at de.gui.Application.start(Application.java:21)
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
>> 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(EclipseS tarter.java:368)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>> 06.07.2009 11:26:40 org.eclipse.emf.teneo.TeneoException <init>
>> SCHWERWIEGEND: Exception when saving resource zlvp
>> org.hibernate.HibernateException: Illegal attempt to associate a
>> collection with two open sessions
>> at
>> org.hibernate.collection.AbstractPersistentCollection.setCur rentSession(AbstractPersistentCollection.java:432)
>> at
>> org.hibernate.event.def.OnUpdateVisitor.processCollection(On UpdateVisitor.java:66)
>> at
>> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:124)
>> at
>> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:84)
>> at
>> org.hibernate.event.def.AbstractVisitor.processEntityPropert yValues(AbstractVisitor.java:78)
>> at
>> org.hibernate.event.def.AbstractVisitor.process(AbstractVisi tor.java:146)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:316)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:246)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:112)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:535)
>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :527)
>> at
>> org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:241)
>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292)
>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :240)
>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
>> at
>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:320)
>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 266)
>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :243)
>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
>> at org.hibernate.engine.Cascade.cascade(Cascade.java:154)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:154)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:145)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:88)
>> at
>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:49)
>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
>> at
>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:171)
>> at
>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:375)
>> at
>> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:405)
>> at
>> de.connection.service.teneo.TeneoLibraryPersistenceService.d oSave(TeneoLibraryPersistenceService.java:58)
>> at
>> de.connection.service.BaseLibraryPersistenceService.save(Bas eLibraryPersistenceService.java:104)
>> at de.gui.editor.AbstractEditor.doSave(AbstractEditor.java:40)
>> 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.ja va:372)
>> at
>> org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:759)
>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>> at
>> org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:756)
>> at
>> org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2578)
>> at
>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:282)
>> at
>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:261)
>> at
>> org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelp er.java:156)
>> at
>> org.eclipse.ui.internal.EditorManager.savePart(EditorManager .java:1357)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage .java:3328)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPa ge.java:3341)
>> 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(ActionHandl er.java:119)
>> at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
>> at
>> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
>> at
>> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:824)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:880)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:569)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
>> at
>> org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:125)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>> at org.eclipse.swt.widgets.Display.filterEvent(Display.java:119 1)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
>> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040 )
>> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036 )
>> at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
>> at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
>> at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946 )
>> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4589 )
>> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
>> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:24 09)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3471)
>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>> at de.gui.Application.start(Application.java:21)
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
>> 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(EclipseS tarter.java:368)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>>
>>
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> Cell: +31 (0)6 288 48 943
> Tel: +31 (0)84 420 2397
> Fax: +31 (0)84 225 9307
> Mail: mtaal@springsite.com - mtaal@elver.org
> Web: www.springsite.com - www.elver.org
Re: [TENEO] Illegal attempt to associate a collection with two open sessions [message #431255 is a reply to message #431254] Mon, 06 July 2009 13:47 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Waldi.
Maybe because Gender does not have collection/list efeatures. Hibernate under-the-hood uses its own list implementations
which are directly linked to a session. So if you move an object with lists (which will be hibernate persistent lists)
to another session then Hibernate complains. If the object does not have list-efeatures then this is okay most of the
time (possibly hibernate proxies can give problems also).

gr. Martin

Waldi wrote:
> Ok, it run realy good. Thanks a lot. But if I associate a Gender or
> something else with the Person I don't need them. Why?
>
> "Martin Taal" <mtaal@elver.org> schrieb im Newsbeitrag
> news:h2sqbq$hhd$1@build.eclipse.org...
>> Hi Waldi,
>> As I remember it you read the person using one resource and then add it to
>> a group in another resource, correct?
>> To prevent this exception both resources should use the same session. See
>> here for more info:
>> http://www.elver.org/hibernate/hibernateresources.html#Shari ng+one+Session+between+Resources%2C+One+transaction+when+sav ing+multiple+resources
>>
>> Let me know if this helps.
>>
>> gr. Martin
>>
>> Waldi wrote:
>>> Hi,
>>>
>>> I try to save a Person to a Group. (Pay attention i've change'd my model.
>>> I attach my new Model.)
>>>
>>> Leiter
>>> Group 1 -----> N Person's
>>>
>>> The following exception occur. I understand it, but i have no idea to
>>> avoid it. I attach my new Model.
>>>
>>> The Error occour if i try to save the main resource, after the
>>> association. This command workes fine but p.save() throw the exception
>>> below.
>>> Command cmd = AddCommand.create(p.getEditingDomain(), gruppe,
>>> ZlvpPackage.Literals.GRUPPE__LEITER, person);
>>> if (cmd.canExecute()) {
>>> p.getEditingDomain().getCommandStack().execute(cmd);
>>> }else{
>>> System.out.println("Hat ned geklappt");
>>> }
>>>
>>> org.hibernate.HibernateException: Illegal attempt to associate a
>>> collection with two open sessions
>>> at
>>> org.hibernate.collection.AbstractPersistentCollection.setCur rentSession(AbstractPersistentCollection.java:432)
>>> at
>>> org.hibernate.event.def.OnUpdateVisitor.processCollection(On UpdateVisitor.java:66)
>>> at
>>> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:124)
>>> at
>>> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:84)
>>> at
>>> org.hibernate.event.def.AbstractVisitor.processEntityPropert yValues(AbstractVisitor.java:78)
>>> at
>>> org.hibernate.event.def.AbstractVisitor.process(AbstractVisi tor.java:146)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:316)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:246)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:112)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
>>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:535)
>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :527)
>>> at
>>> org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:241)
>>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292)
>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :240)
>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
>>> at
>>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:320)
>>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 266)
>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :243)
>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:154)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:154)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:145)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:88)
>>> at
>>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:49)
>>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:171)
>>> at
>>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:375)
>>> at
>>> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:405)
>>> at
>>> de.connection.service.teneo.TeneoLibraryPersistenceService.d oSave(TeneoLibraryPersistenceService.java:58)
>>> at
>>> de.connection.service.BaseLibraryPersistenceService.save(Bas eLibraryPersistenceService.java:104)
>>> at de.gui.editor.AbstractEditor.doSave(AbstractEditor.java:40)
>>> 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.ja va:372)
>>> at
>>> org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:759)
>>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>> at
>>> org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:756)
>>> at
>>> org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2578)
>>> at
>>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:282)
>>> at
>>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:261)
>>> at
>>> org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelp er.java:156)
>>> at
>>> org.eclipse.ui.internal.EditorManager.savePart(EditorManager .java:1357)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage .java:3328)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPa ge.java:3341)
>>> 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(ActionHandl er.java:119)
>>> at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
>>> at
>>> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
>>> at
>>> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:824)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:880)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:569)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:125)
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>>> at org.eclipse.swt.widgets.Display.filterEvent(Display.java:119 1)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
>>> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040 )
>>> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036 )
>>> at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
>>> at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
>>> at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946 )
>>> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4589 )
>>> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
>>> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:24 09)
>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3471)
>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>>> at
>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>> at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>> at de.gui.Application.start(Application.java:21)
>>> at
>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
>>> 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(EclipseS tarter.java:368)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>>> 06.07.2009 11:26:40 org.eclipse.emf.teneo.TeneoException <init>
>>> SCHWERWIEGEND: Exception when saving resource zlvp
>>> org.hibernate.HibernateException: Illegal attempt to associate a
>>> collection with two open sessions
>>> at
>>> org.hibernate.collection.AbstractPersistentCollection.setCur rentSession(AbstractPersistentCollection.java:432)
>>> at
>>> org.hibernate.event.def.OnUpdateVisitor.processCollection(On UpdateVisitor.java:66)
>>> at
>>> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:124)
>>> at
>>> org.hibernate.event.def.AbstractVisitor.processValue(Abstrac tVisitor.java:84)
>>> at
>>> org.hibernate.event.def.AbstractVisitor.processEntityPropert yValues(AbstractVisitor.java:78)
>>> at
>>> org.hibernate.event.def.AbstractVisitor.process(AbstractVisi tor.java:146)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formUpdate(DefaultSaveOrUpdateEventListener.java:316)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsDetached(DefaultSaveOrUpdateEventListener.java:246)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:112)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
>>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:535)
>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :527)
>>> at
>>> org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:241)
>>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292)
>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :240)
>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
>>> at
>>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:320)
>>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 266)
>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :243)
>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:19 3)
>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:154)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:154)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:145)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:88)
>>> at
>>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:49)
>>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:171)
>>> at
>>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:375)
>>> at
>>> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:405)
>>> at
>>> de.connection.service.teneo.TeneoLibraryPersistenceService.d oSave(TeneoLibraryPersistenceService.java:58)
>>> at
>>> de.connection.service.BaseLibraryPersistenceService.save(Bas eLibraryPersistenceService.java:104)
>>> at de.gui.editor.AbstractEditor.doSave(AbstractEditor.java:40)
>>> 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.ja va:372)
>>> at
>>> org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:759)
>>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>> at
>>> org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:756)
>>> at
>>> org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2578)
>>> at
>>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:282)
>>> at
>>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:261)
>>> at
>>> org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelp er.java:156)
>>> at
>>> org.eclipse.ui.internal.EditorManager.savePart(EditorManager .java:1357)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage .java:3328)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPa ge.java:3341)
>>> 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(ActionHandl er.java:119)
>>> at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
>>> at
>>> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
>>> at
>>> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:824)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:880)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:569)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
>>> at
>>> org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:125)
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>>> at org.eclipse.swt.widgets.Display.filterEvent(Display.java:119 1)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
>>> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040 )
>>> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036 )
>>> at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
>>> at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
>>> at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946 )
>>> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4589 )
>>> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
>>> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:24 09)
>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3471)
>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>>> at
>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>> at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>> at de.gui.Application.start(Application.java:21)
>>> at
>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
>>> 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(EclipseS tarter.java:368)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>>>
>>>
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> Cell: +31 (0)6 288 48 943
>> Tel: +31 (0)84 420 2397
>> Fax: +31 (0)84 225 9307
>> Mail: mtaal@springsite.com - mtaal@elver.org
>> Web: www.springsite.com - www.elver.org
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:Handling XMI Documents Serialized from a Different Version of Your Model.
Next Topic:EStructuralFeature.isNullable()
Goto Forum:
  


Current Time: Fri Dec 06 15:44:10 GMT 2019

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

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

Back to the top