Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352191 - Locking detached elements
Summary: Locking detached elements
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-15 05:39 EDT by Alex Lagarde CLA
Modified: 2012-09-21 07:16 EDT (History)
1 user (show)

See Also:


Attachments
Fix (6.62 KB, patch)
2011-08-04 07:34 EDT, Eike Stepper CLA
no flags Details | Diff
Fix v2 (6.65 KB, patch)
2011-08-04 11:14 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Lagarde CLA 2011-07-15 05:39:06 EDT
As it has been discussed on the forum : http://www.eclipse.org/forums/index.php/t/217079/

it is possible to lock detached elements using a CDOTransactionHandler1.

JUnit tests should be written to ensure that this usecase works correctly
Comment 1 Eike Stepper CLA 2011-08-04 07:34:01 EDT
Created attachment 200903 [details]
Fix

It turns out that TRANSIENT (detached) objects can not be locked through CDOObject.cdoXyzLock().lock() because they have no view pointer anymore. This situation is detected and an IllegalStateException thrown with the hint to cll CDOView.lockObjects() instead.
Comment 2 Eike Stepper CLA 2011-08-04 07:34:43 EDT
Test is in org.eclipse.emf.cdo.tests.LockingManagerTest.testLockDetached()
Comment 3 Eike Stepper CLA 2011-08-04 11:14:20 EDT
Created attachment 200922 [details]
Fix v2
Comment 4 Eike Stepper CLA 2011-08-04 11:15:22 EDT
Committed revision 8864
Comment 5 Eike Stepper CLA 2012-09-21 07:16:22 EDT
Closing.