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

Bug 316421

Summary: Provide an option to lock reference targets during commit
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
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: offline-07
Attachments:
Description Flags
Patch for future reference none

Description Erwin Betschart CLA 2010-06-10 03:21:03 EDT
Build Identifier: 3.0

CDO should provide an option to lock outgoing reference targets during commit. 
This would prevent a case of stale references.
E.g.: 
Object A references object B. When changing and committing the object A also object B should be locked so that no one can remove object B.

Reproducible: Always
Comment 1 Caspar D. CLA 2010-06-10 06:19:00 EDT
Doesn't this duplicate bug 315407 ?
Comment 2 Eike Stepper CLA 2010-06-13 01:31:08 EDT
The new reference target locking can be switched on with a new *boolean* repository property:

   IStoreAccessor.CommitContext.PROP_AUTO_LOCK_NEW_TARGETS = "autoLockNewTargets"
   
It is off by default!
Comment 3 Eike Stepper CLA 2010-06-13 01:31:24 EDT
Committed to HEAD
Comment 4 Eike Stepper CLA 2010-06-13 01:34:38 EDT
Created attachment 171792 [details]
Patch for future reference
Comment 5 Eike Stepper CLA 2010-06-13 02:57:58 EDT
Update: The property has been moved to IRepository.Props.AUTO_LOCK_NEW_TARGETS
Comment 6 Eike Stepper CLA 2010-06-29 04:40:04 EDT
Available in 3.0 GA:
http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/