Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 298178 - DanglingReference when moving an object containment
Summary: DanglingReference when moving an object containment
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-18 09:26 EST by Gonzague Reydet CLA
Modified: 2010-06-29 09:22 EDT (History)
0 users

See Also:


Attachments
A test case to reproduce (1.48 KB, patch)
2009-12-18 09:30 EST, Gonzague Reydet CLA
stepper: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gonzague Reydet CLA 2009-12-18 09:26:53 EST
Build Identifier: 

The following DanglingReferenceException is thrown when commiting a new object that was moved from a new transient container to another container (in my case a resource).

This exception does not occur when the origin container was previously commited to CDO repository.


Caused by: org.eclipse.emf.cdo.util.DanglingReferenceException: The object "Company?(org.eclipse.emf.cdo.tests.model1.impl.CompanyImpl)" is not contained in a resource
	at org.eclipse.emf.internal.cdo.view.CDOViewImpl.provideCDOID(CDOViewImpl.java:970)
	at org.eclipse.emf.cdo.spi.common.revision.AbstractCDORevision.write(AbstractCDORevision.java:171)
	at org.eclipse.emf.cdo.internal.common.io.CDODataOutputImpl.writeCDORevision(CDODataOutputImpl.java:177)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.writeRevisions(CommitTransactionRequest.java:305)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requestingCommit(CommitTransactionRequest.java:162)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requesting(CommitTransactionRequest.java:124)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requesting(CommitTransactionRequest.java:101)
	at org.eclipse.net4j.signal.RequestWithMonitoring.requesting(RequestWithMonitoring.java:163)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedOutput(RequestWithConfirmation.java:117)
	at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:281)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:102)
	at org.eclipse.net4j.signal.RequestWithMonitoring.doExecute(RequestWithMonitoring.java:233)
	at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:66)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:238)
	at org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:423)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:87)
	at org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:73)
	at org.eclipse.net4j.signal.RequestWithMonitoring.send(RequestWithMonitoring.java:108)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:326)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.commitTransaction(CDOClientProtocol.java:236)
	at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:58)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:595)


Reproducible: Always

Steps to Reproduce:
See attached test case
Comment 1 Gonzague Reydet CLA 2009-12-18 09:30:38 EST
Created attachment 154776 [details]
A test case to reproduce
Comment 2 Gonzague Reydet CLA 2009-12-18 09:32:52 EST
I tested this issue on CDO R2_0 branch and head sources
Comment 3 Eike Stepper CLA 2010-03-10 07:24:33 EST
Committed test case to HEAD.

Gonzague, please confirm:

Please confirm the following:

1) The number of lines that you changed is smaller than 250.
2) You are the only author of these changed lines.
3) You apply the EPL to these changed lines.
Comment 4 Eike Stepper CLA 2010-03-10 07:25:41 EST
Gonzague, your test case does not fail (anymore). Could you verify if your problem was silently fixed by other changes?
Comment 5 Gonzague Reydet CLA 2010-03-10 10:02:31 EST
Just updated to head revision and the test is green now!

I confirm that I am the only author of those 23 lines of code and I apply EPL on it.
Comment 6 Eike Stepper CLA 2010-03-10 10:17:56 EST
Thank you, Gonzague.
Comment 7 Eike Stepper CLA 2010-06-29 04:35:44 EDT
Available in 3.0 GA:
http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/