| Summary: | [DB] Duplicate entry / Violation of unique index in 'cdo_package_units_idx0' | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | kaab <kaabab> | ||||||||||
| Component: | cdo.db | Assignee: | Eike Stepper <stepper> | ||||||||||
| Status: | CLOSED FIXED | QA Contact: | Eike Stepper <stepper> | ||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | picard, saulius.tvarijonas, stefan, stepper | ||||||||||
| Version: | 4.1 | ||||||||||||
| Target Milestone: | --- | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Linux | ||||||||||||
| Whiteboard: | |||||||||||||
| Bug Depends on: | |||||||||||||
| Bug Blocks: | 353448 | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
kaab
Created attachment 200465 [details]
Test case to reproduce the error
Test Case to reproduce the issue
We'll analyze this in 4.1 first and then eventually port thr fix to maintenance. Stefan, is this issue a result of *some* SQL DBs not properly executing DDL in the transaction context? Abdel, starting with CDO 4.0 you can nicely work around this issue by using the new method IRepository.setInitialPackages(EPackage...), which must be called *before te repository is started for the first time* . (In reply to comment #2) > Stefan, is this issue a result of *some* SQL DBs not properly executing DDL in > the transaction context? Maybe. I cannot say for sure. Another possibility could be that the server does not notice that it receives the same package multiple times and it regards the same package as new in two different threads. But I assume this mechanism is generally thread safe? (In reply to comment #3) > Another possibility could be that the server does not notice that it receives > the same package multiple times and it regards the same package as new in two > different threads. > But I assume this mechanism is generally thread safe? That does ring a bell. I think we don't lock meta instances at all! Probably because they are always immutable and I did not consider that two commits with any new packages should compete for exclusive package registry access. Assigning to myself... Created attachment 200797 [details]
Test case as patch (easier to apply)
BTW. the test case does pass for me.
(In reply to comment #5) > Created attachment 200797 [details] > Test case as patch (easier to apply) > > BTW. the test case does pass for me. The test does pass but produces an exception, reproducing the exception was the objective behind the test, I just wanted to provide some fast way to reproduce this in CDO environment without going trough all the configuration needed for a CDO store, so I used the testing framework. Just to make sure, I've just re-run this test on a different machine and the error was still reproducible. Created attachment 200873 [details]
Fix
Created attachment 200874 [details]
Fix v2
Committed revision 8856: - trunk/plugins/org.eclipse.emf.cdo.common - trunk/plugins/org.eclipse.emf.cdo.server - trunk/plugins/org.eclipse.emf.cdo.tests Resolved. Tested in PackageRegistryTest.testConcurrentPackageRegistration2() Closing. |