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

Bug 316434

Summary: Provide an option which prevents removal of still referenced objects (referential integrity)
Product: [Modeling] EMF Reporter: Erwin Betschart <erwin>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: enhancement    
Priority: P3 CC: caspar_d, Michal.Tkacz, stepper
Version: 4.0Keywords: noteworthy
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: Power to the People
Attachments:
Description Flags
Patch v1
none
Patch v2 none

Description Erwin Betschart CLA 2010-06-10 05:29:51 EDT
Build Identifier: 3.0

CDO should provide an option which prevents (on the server) the removal of objects which are still referenced (incoming references).

Concurrent commits of two client can cause the local consistent model to become inconsistent on the server:
Object A references object B
Client 1: Add C which references B
Client 2: Delete A & B (commit should fail because B is still referenced by C)
(Assuming client did not yet receive the invalidation of the first commit)

Reproducible: Always
Comment 1 Caspar D. CLA 2010-06-10 06:31:00 EDT
Doesn't this duplicate bug 315407 and bug 316421 ?

The way I see it, we just don't have a server-side check
preventing removal of reference targets. IMO such a check
(as I suppose Eike has implemented in his patch for bug 315407)
would solve all 3 issues...

Or are there subtle differences that I'm not thinking of?
Comment 2 Eike Stepper CLA 2010-06-19 02:05:23 EDT
The boolean configuration property of the server to control this behaviour is IRepository.Props.ENSURE_REFERENTIAL_INTEGRITY = "ensureReferentialIntegrity". The same property is used to control the behaviour of bug 315407.
Comment 3 Eike Stepper CLA 2010-06-29 04:50:20 EDT
Rebasing all outstanding enhancements requests to version 4.0
Comment 4 Eike Stepper CLA 2010-07-05 11:11:18 EDT
Created attachment 173443 [details]
Patch v1
Comment 5 Eike Stepper CLA 2010-07-05 15:45:25 EDT
Created attachment 173474 [details]
Patch v2
Comment 6 Eike Stepper CLA 2010-07-06 06:03:45 EDT
Committed to HEAD
Comment 7 Eike Stepper CLA 2011-06-23 03:40:44 EDT
Available in R20110608-1407