| Summary: | [DB] create unique constraints on table PKs to prevent data corruption | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Stefan Winkler <stefan> | ||||||
| Component: | cdo.db | Assignee: | Stefan Winkler <stefan> | ||||||
| Status: | CLOSED FIXED | QA Contact: | Eike Stepper <stepper> | ||||||
| Severity: | enhancement | ||||||||
| Priority: | P3 | CC: | caspar_d, saulius.tvarijonas | ||||||
| Version: | 2.0 | Flags: | stefan:
galileo+
stepper: review+ |
||||||
| Target Milestone: | SR2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 292137 | ||||||||
| Attachments: |
|
||||||||
|
Description
Stefan Winkler
Created attachment 149439 [details]
Patch-v1
Added UNIQUE index creation commands for class and list mappings.
(Only affect newly created repositories, migration path for existing repositories would be to create the indexes manually)
Still have to run testsuites to check if they have any unwanted impact.
Created attachment 149509 [details]
Patch-v2
I missed the cdo_index field in the first patch.
This one is ok and testcases for HSQL and H2 run without errors in both audit and non-audit modes.
Should be ok to apply.
(In reply to comment #2) Stefan, Thanks for your quick help. I've patched our CDO, we'll try it out. Regards /Caspar Just in case it's not already clear: this patch won't make the inherent problem of Bug 292137 go away. Most likely you will get TransactionExceptions because you concurrently modify revisions or something. This patch should just prevent data corruption in such a case (i.e., by throwing the exception at commit time). Patch works. Can this be committed to HEAD and 2.0-maintenance? Committed to R2_0_maintenance |