Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333294 - Repo not writeable after import
Summary: Repo not writeable after import
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.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-12-29 05:37 EST by Caspar D. CLA
Modified: 2011-06-23 03:39 EDT (History)
1 user (show)

See Also:
stepper: review+


Attachments
Stacktrace (4.83 KB, text/plain)
2010-12-29 05:37 EST, Caspar D. CLA
no flags Details
Testcase (as a patch) (1.87 KB, patch)
2010-12-29 05:39 EST, Caspar D. CLA
no flags Details | Diff
Patch v1 (including testcase) (3.50 KB, patch)
2010-12-29 06:29 EST, 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-12-29 05:37:19 EST
Created attachment 185870 [details]
Stacktrace

When one imports a repository and then commits new
data to it, an IllegalStateException gets thrown (for MEMStore;
for DBStore the exception is a PK violation).

See attached stacktrace & testcase.
Comment 1 Caspar D. CLA 2010-12-29 05:39:49 EST
Created attachment 185871 [details]
Testcase (as a patch)

Extended BackupTest.testImport() to demonstrate the problem.
Comment 2 Caspar D. CLA 2010-12-29 05:52:04 EST
Problem seems to be that the first object that gets
committed after the import, receives OID1. But the commit
logic finds an existing object for that ID, of course.
Comment 3 Caspar D. CLA 2010-12-29 06:28:01 EST
... which in turn is because the import logic uses
MEMStore.addRevision(InternalCDORevision revision, boolean raw) to
add revisions, which doesn't raise the lastObjectID.

Attaching a patch shortly.
Comment 4 Caspar D. CLA 2010-12-29 06:29:38 EST
Created attachment 185875 [details]
Patch v1 (including testcase)
Comment 5 Eike Stepper CLA 2011-01-02 04:35:38 EST
Good catch. I guess the DBStore is considered in one of the other import bugzillas...
Comment 6 Caspar D. CLA 2011-01-03 21:59:09 EST
Committed to HEAD
Comment 7 Eike Stepper CLA 2011-06-23 03:39:39 EDT
Available in R20110608-1407