Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353076 - Failure when trying to unlock a collection of elements
Summary: Failure when trying to unlock a collection of elements
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-26 03:17 EDT by Alex Lagarde CLA
Modified: 2012-09-21 06:51 EDT (History)
2 users (show)

See Also:


Attachments
Patch v1 - for future reference (11.37 KB, patch)
2011-07-26 03:34 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-26 03:17:32 EDT
This bug has been discussed in the following post : http://www.eclipse.org/forums/index.php/t/223982/

 I've got an issue when trying to unlock more 
than one element at a time :

if I write :

transaction.unlockObjects(elementsToUnlock, CDO_WRITE_LOCK);


I get the following exceptions :

org.eclipse.net4j.signal.RemoteException: 
java.lang.IllegalMonitorStateException
at 
org.eclipse.net4j.signal.RequestWithConfirmation.getRemoteException(RequestWithConfirmation.java:139)
at 
org.eclipse.net4j.signal.RequestWithConfirmation.setRemoteException(RequestWithConfirmation.java:128)
at 
org.eclipse.net4j.signal.SignalProtocol.handleRemoteException(SignalProtocol.java:423)
at 
org.eclipse.net4j.signal.RemoteExceptionIndication.indicating(RemoteExceptionIndication.java:63)
at org.eclipse.net4j.signal.Indication.doExtendedInput(Indication.java:55)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
at org.eclipse.net4j.signal.Indication.execute(Indication.java:49)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalMonitorStateException
at 
org.eclipse.net4j.util.concurrent.RWLockManager.unlock(RWLockManager.java:284)
at 
org.eclipse.net4j.util.concurrent.RWLockManager.unlock(RWLockManager.java:139)
at 
org.eclipse.emf.cdo.internal.server.LockManager.unlock(LockManager.java:192)
at 
org.eclipse.emf.cdo.server.internal.net4j.protocol.UnlockObjectsIndication.indicating(UnlockObjectsIndication.java:68)
at 
org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndication.indicating(CDOServerIndication.java:84)
at 
org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
at 
org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
at 
org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerWriteIndication.execute(CDOServerWriteIndication.java:39)


But if I unlock my elements one by one :

for (CDOObject unlockedElement : unlockedElements) {
	transaction.unlockObjects(unlockedElements, CDO_WRITE_LOCK);
}


Everything works fine.
Comment 1 Eike Stepper CLA 2011-07-26 03:34:06 EDT
Created attachment 200338 [details]
Patch v1 - for future reference
Comment 2 Eike Stepper CLA 2011-07-26 03:34:26 EDT
Committed revision 8818:
- branches/4.0-maintenance/plugins/org.eclipse.emf.cdo.net4j
- branches/4.0-maintenance/plugins/org.eclipse.emf.cdo.tests
Comment 3 Eike Stepper CLA 2011-07-26 03:34:44 EDT
Resolved.
Comment 4 Eike Stepper CLA 2012-09-21 06:51:47 EDT
Closing.