Teneo : JDOUserException while changing eContainer of an object [message #57975] |
Wed, 18 October 2006 15:34 |
Eclipse User |
|
|
|
Originally posted by: mat.loo.gmail.com
Hi,
I try to change the container of an EObject. The EMF Command that does so
is a Compound one that removes (RemoveCommand) the object from the list of
its container (and the cross reference is also deleted) and then a set the
new Container to my object (SetCommand).
While notifying the remove, when trying to remove my object from
StoreResource.loadedObjects, it does a loadedObjects.remove(myObject) that
calls the equals of my object and you can see what happens.
Isn't it possible to change the container of an object in Teneo/JPox
context ?
Should I override the commands ? And How ? My object will still be without
container at a given time, am I right ?
Thx
Caused by: javax.jdo.JDOUserException: Cannot read fields from a deleted
object
FailedObject:6[OID]thales.themis.macha.impl.A429_BusImpl
at
org.jpox.state.jdo.PersistentDeleted.transitionReadField(Per sistentDeleted.java:115)
at
org.jpox.state.StateManagerImpl.transitionReadField(StateMan agerImpl.java:3256)
at org.jpox.state.StateManagerImpl.isLoaded(StateManagerImpl.ja va:1906)
at thales.themis.macha.impl.A429_BusImpl.jdoGetbus_name(A429_Bu sImpl.java)
at
thales.themis.macha.impl.A429_BusImpl.getBus_name(A429_BusIm pl.java:307)
at thales.themis.macha.impl.A429_BusImpl.equals(A429_BusImpl.ja va:783)
at java.util.ArrayList.remove(ArrayList.java:425)
at
org.eclipse.emf.teneo.resource.StoreResource.removedEObject( StoreResource.java:419)
at
org.eclipse.emf.teneo.resource.StoreResource.detachedHelper( StoreResource.java:481)
at
org.eclipse.emf.teneo.jpox.resource.JPOXResource.detached(JP OXResource.java:183)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eBasicSetContain er(BasicEObjectImpl.java:903)
at
thales.themis.macha.impl.A429_BusImpl.basicSetSpecification( A429_BusImpl.java:529)
at
thales.themis.macha.impl.A429_BusImpl.eInverseRemove(A429_Bu sImpl.java:587)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eInverseRemove(B asicEObjectImpl.java:1016)
at
org.eclipse.emf.ecore.util.DelegatingEcoreEList.inverseRemov e(DelegatingEcoreEList.java:402)
at
org.eclipse.emf.common.notify.impl.DelegatingNotifyingListIm pl.remove(DelegatingNotifyingListImpl.java:688)
at
org.eclipse.emf.edit.command.RemoveCommand.doExecute(RemoveC ommand.java:322)
at
org.eclipse.emf.edit.command.AbstractOverrideableCommand.exe cute(AbstractOverrideableCommand.java:128)
at
org.eclipse.emf.common.command.CompoundCommand.execute(Compo undCommand.java:268)
at
org.eclipse.emf.common.command.BasicCommandStack.execute(Bas icCommandStack.java:91)
|
|
|
Re: Teneo : JDOUserException while changing eContainer of an object [message #57999 is a reply to message #57975] |
Wed, 18 October 2006 15:40 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Mat,
You should not override equals on an EObject implementation. EMF
relies on being able to use == for comparison and assumes this will
behave the same as .equals. EMF also relies on being able to use
EObjects as keys in a map, so making equality depend on the state of the
object will break that capability. EcoreUtil.equals can be used to do
structural equality checking...
Mat Lo wrote:
> Hi,
>
> I try to change the container of an EObject. The EMF Command that does
> so is a Compound one that removes (RemoveCommand) the object from the
> list of its container (and the cross reference is also deleted) and
> then a set the new Container to my object (SetCommand).
>
> While notifying the remove, when trying to remove my object from
> StoreResource.loadedObjects, it does a loadedObjects.remove(myObject)
> that calls the equals of my object and you can see what happens.
>
> Isn't it possible to change the container of an object in Teneo/JPox
> context ?
> Should I override the commands ? And How ? My object will still be
> without container at a given time, am I right ?
>
> Thx
>
> Caused by: javax.jdo.JDOUserException: Cannot read fields from a
> deleted object
> FailedObject:6[OID]thales.themis.macha.impl.A429_BusImpl
> at
> org.jpox.state.jdo.PersistentDeleted.transitionReadField(Per sistentDeleted.java:115)
>
> at
> org.jpox.state.StateManagerImpl.transitionReadField(StateMan agerImpl.java:3256)
>
> at
> org.jpox.state.StateManagerImpl.isLoaded(StateManagerImpl.ja va:1906)
> at
> thales.themis.macha.impl.A429_BusImpl.jdoGetbus_name(A429_Bu sImpl.java)
> at
> thales.themis.macha.impl.A429_BusImpl.getBus_name(A429_BusIm pl.java:307)
> at
> thales.themis.macha.impl.A429_BusImpl.equals(A429_BusImpl.ja va:783)
> at java.util.ArrayList.remove(ArrayList.java:425)
> at
> org.eclipse.emf.teneo.resource.StoreResource.removedEObject( StoreResource.java:419)
>
> at
> org.eclipse.emf.teneo.resource.StoreResource.detachedHelper( StoreResource.java:481)
>
> at
> org.eclipse.emf.teneo.jpox.resource.JPOXResource.detached(JP OXResource.java:183)
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eBasicSetContain er(BasicEObjectImpl.java:903)
>
> at
> thales.themis.macha.impl.A429_BusImpl.basicSetSpecification( A429_BusImpl.java:529)
>
> at
> thales.themis.macha.impl.A429_BusImpl.eInverseRemove(A429_Bu sImpl.java:587)
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eInverseRemove(B asicEObjectImpl.java:1016)
>
> at
> org.eclipse.emf.ecore.util.DelegatingEcoreEList.inverseRemov e(DelegatingEcoreEList.java:402)
>
> at
> org.eclipse.emf.common.notify.impl.DelegatingNotifyingListIm pl.remove(DelegatingNotifyingListImpl.java:688)
>
> at
> org.eclipse.emf.edit.command.RemoveCommand.doExecute(RemoveC ommand.java:322)
>
> at
> org.eclipse.emf.edit.command.AbstractOverrideableCommand.exe cute(AbstractOverrideableCommand.java:128)
>
> at
> org.eclipse.emf.common.command.CompoundCommand.execute(Compo undCommand.java:268)
>
> at
> org.eclipse.emf.common.command.BasicCommandStack.execute(Bas icCommandStack.java:91)
>
>
|
|
|
|
Re: Teneo : JDOUserException while changing eContainer of an object [message #594260 is a reply to message #57975] |
Wed, 18 October 2006 15:40 |
Ed Merks Messages: 33236 Registered: July 2009 |
Senior Member |
|
|
Mat,
You should not override equals on an EObject implementation. EMF
relies on being able to use == for comparison and assumes this will
behave the same as .equals. EMF also relies on being able to use
EObjects as keys in a map, so making equality depend on the state of the
object will break that capability. EcoreUtil.equals can be used to do
structural equality checking...
Mat Lo wrote:
> Hi,
>
> I try to change the container of an EObject. The EMF Command that does
> so is a Compound one that removes (RemoveCommand) the object from the
> list of its container (and the cross reference is also deleted) and
> then a set the new Container to my object (SetCommand).
>
> While notifying the remove, when trying to remove my object from
> StoreResource.loadedObjects, it does a loadedObjects.remove(myObject)
> that calls the equals of my object and you can see what happens.
>
> Isn't it possible to change the container of an object in Teneo/JPox
> context ?
> Should I override the commands ? And How ? My object will still be
> without container at a given time, am I right ?
>
> Thx
>
> Caused by: javax.jdo.JDOUserException: Cannot read fields from a
> deleted object
> FailedObject:6[OID]thales.themis.macha.impl.A429_BusImpl
> at
> org.jpox.state.jdo.PersistentDeleted.transitionReadField(Per sistentDeleted.java:115)
>
> at
> org.jpox.state.StateManagerImpl.transitionReadField(StateMan agerImpl.java:3256)
>
> at
> org.jpox.state.StateManagerImpl.isLoaded(StateManagerImpl.ja va:1906)
> at
> thales.themis.macha.impl.A429_BusImpl.jdoGetbus_name(A429_Bu sImpl.java)
> at
> thales.themis.macha.impl.A429_BusImpl.getBus_name(A429_BusIm pl.java:307)
> at
> thales.themis.macha.impl.A429_BusImpl.equals(A429_BusImpl.ja va:783)
> at java.util.ArrayList.remove(ArrayList.java:425)
> at
> org.eclipse.emf.teneo.resource.StoreResource.removedEObject( StoreResource.java:419)
>
> at
> org.eclipse.emf.teneo.resource.StoreResource.detachedHelper( StoreResource.java:481)
>
> at
> org.eclipse.emf.teneo.jpox.resource.JPOXResource.detached(JP OXResource.java:183)
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eBasicSetContain er(BasicEObjectImpl.java:903)
>
> at
> thales.themis.macha.impl.A429_BusImpl.basicSetSpecification( A429_BusImpl.java:529)
>
> at
> thales.themis.macha.impl.A429_BusImpl.eInverseRemove(A429_Bu sImpl.java:587)
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eInverseRemove(B asicEObjectImpl.java:1016)
>
> at
> org.eclipse.emf.ecore.util.DelegatingEcoreEList.inverseRemov e(DelegatingEcoreEList.java:402)
>
> at
> org.eclipse.emf.common.notify.impl.DelegatingNotifyingListIm pl.remove(DelegatingNotifyingListImpl.java:688)
>
> at
> org.eclipse.emf.edit.command.RemoveCommand.doExecute(RemoveC ommand.java:322)
>
> at
> org.eclipse.emf.edit.command.AbstractOverrideableCommand.exe cute(AbstractOverrideableCommand.java:128)
>
> at
> org.eclipse.emf.common.command.CompoundCommand.execute(Compo undCommand.java:268)
>
> at
> org.eclipse.emf.common.command.BasicCommandStack.execute(Bas icCommandStack.java:91)
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.04118 seconds