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

Bug 331775

Summary: Raw replication failure is not cleaned up properly
Product: [Modeling] EMF Reporter: Erwin Betschart <erwin>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3    
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Proposed patch stepper: iplog+

Description Erwin Betschart CLA 2010-12-03 10:26:42 EST
Build Identifier: 4.0

In case of a raw replication failure the changes done in the db (like creating new tables) are not undone.

Patch will be attached.

Reproducible: Always
Comment 1 Erwin Betschart CLA 2010-12-03 10:35:51 EST
Created attachment 184472 [details]
Proposed patch

The patch removes all already created new mapping tables in the db in case of an error. That is the next raw replication will not fail with a "Table already exists" error.

In rawImportPackageUnits a new db connection is created due to:
In H2 the CREATE TABLE statement commits the transaction (see http://www.h2database.com/html/grammar.html#create_table) therefore the changes done before creating the table cannot be undone by calling connection.rollback().

This patch was only tested with an H2 database!
Comment 2 Eike Stepper CLA 2010-12-27 06:57:00 EST
Good catch, Erwin. Please confirm that:

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 3 Eike Stepper CLA 2010-12-27 08:02:22 EST
Committed to HEAD
Comment 4 Erwin Betschart CLA 2011-01-03 03:28:56 EST
I confirm that:
 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 5 Eike Stepper CLA 2011-06-23 03:40:22 EDT
Available in R20110608-1407