Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312205

Summary: After detach-reattach-rollback, object is not present in tx
Product: [Modeling] EMF Reporter: Caspar D. <caspar_d>
Component: cdo.coreAssignee: Caspar D. <caspar_d>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: saulius.tvarijonas
Version: 3.0Flags: stepper: review+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch for 3.0
none
Patch v2 - ready to be committed
none
Cleaned up the unit test none

Description Caspar D. CLA 2010-05-10 02:20:20 EDT
If one detaches an object and reattaches it, with no
savepoint in between, then rolls the tx back, undoing both the
reattachment and the detachment, the net effect should be no
change. But actually after the rollback the object that was
detached/reattached will no longer be present in the views
"objects" collection.

Requesting it on the basis of its CDOID will produce it in
the correct state, but it'll be a new instance which will
newly be added to the objects collection, not the instance
that was originally detached-then-reattached.
Comment 1 Caspar D. CLA 2010-05-10 05:10:45 EDT
I have a test and a patch for this, but currently I can't
SSH to the CVS server, so I can't do a CVS diff.

To be continued.
Comment 2 Caspar D. CLA 2010-05-10 06:51:33 EDT
Created attachment 167684 [details]
Patch for 3.0

Patch includes testcase
Comment 3 Eike Stepper CLA 2010-05-10 07:18:04 EDT
Created attachment 167687 [details]
Patch v2 - ready to be committed

Optimized the reattachedNotDetached check with the map keys as discussed offline.
Comment 4 Caspar D. CLA 2010-05-11 04:57:15 EDT
Committed to HEAD
Comment 5 Caspar D. CLA 2010-05-12 00:57:14 EDT
Created attachment 168080 [details]
Cleaned up the unit test
Comment 6 Caspar D. CLA 2010-05-12 01:00:02 EDT
Reopening to trigger review of the cleaned up unit test 
I just attached.
Comment 7 Caspar D. CLA 2010-05-24 04:28:32 EDT
Committed to HEAD.
Comment 8 Eike Stepper CLA 2010-06-29 04:36:44 EDT
Available in 3.0 GA:
http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/