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

Bug 333294

Summary: Repo not writeable after import
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: 4.0Flags: stepper: review+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Stacktrace
none
Testcase (as a patch)
none
Patch v1 (including testcase) none

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