Community
Participate
Working Groups
Created attachment 196077 [details] A simple metamodel allowing to reproduce this issue Issue description =================== When using a very simple metamodel in legacy mode, the objects wrapped by the CDOLegacyWrapper are not properly deleted. When trying to delete a "Car" for its "Garage" container (contained in the "cars" reference), the following methods are called : CDOLegacyAdapter(CDOLegacyWrapper).adjustOppositeReference(InternalCDOObject, EObject, EReference) line: 809 CDOLegacyAdapter(CDOLegacyWrapper).cdoInternalPostDetach(boolean) line: 173 CDOStateMachine.detach(InternalCDOObject) line: 271 CDOResourceImpl.detached(EObject) line: 1187 CarImpl(BasicEObjectImpl).eBasicSetContainer(InternalEObject, int, NotificationChain) line: 1334 CarImpl(BasicEObjectImpl).eInverseRemove(InternalEObject, int, Class<?>, NotificationChain) line: 1451 EObjectContainmentEList$Resolving<E>(EcoreEList<E>).inverseRemove(E, NotificationChain) line: 328 EObjectContainmentEList$Resolving<E>(NotifyingListImpl<E>).remove(int) line: 716 EObjectContainmentEList$Resolving<E>(AbstractEList<E>).remove(Object) line: 466 EcoreUtil.remove(EObject, EStructuralFeature, Object) line: 3030 When I inspect the container just after the call to ECoreUtil.remove, my Garage still contains the deleted Car. However, calling deletedCar.eContainer() returns null. Possible causes =================== CDOLegacyWrapper.adjustOppositeReference() calls CDOLegacyWrapper.adjustTransientOppositeReference(), which adds the deleted Car to the "cars" reference of the Garage. This does not seems right, but you must have a good reason to do so.
Hi Alex, could you try to reproduce this issue with HEAD. The Legacy wrapper currently does not use the method *adjustOppositeReference(InternalCDOObject, EObject, EReference)* anymore. Which version of CDO are you using?
Hi Martin, sorry for the delay, updating our environment was not what one could call an easy task :) I've tried to reproduce this issue on the latest stable build (RC2a), it now works fine. Thanks for your help ! Alex
You are welcome :)
Closing.