Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312205 - After detach-reattach-rollback, object is not present in tx
Summary: After detach-reattach-rollback, object is not present in tx
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: Caspar D. CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-10 02:20 EDT by Caspar D. CLA
Modified: 2010-06-29 09:23 EDT (History)
1 user (show)

See Also:
stepper: review+


Attachments
Patch for 3.0 (5.20 KB, patch)
2010-05-10 06:51 EDT, Caspar D. CLA
no flags Details | Diff
Patch v2 - ready to be committed (5.55 KB, patch)
2010-05-10 07:18 EDT, Eike Stepper CLA
no flags Details | Diff
Cleaned up the unit test (2.58 KB, patch)
2010-05-12 00:57 EDT, Caspar D. CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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/