[CDO] Thread blocked on CDOIDUtil.createLong [message #1850736] |
Tue, 15 March 2022 17:41 |
Gabe Colburn Messages: 28 Registered: December 2012 |
Junior Member |
|
|
We have a multi-threaded application using CDO. We sometimes need to store CDOID's in an external database for later retrieval.
To retrieve the objects, once we have the ID from the external system:
long cdoIdToRetrieve = getId() // made up function returning the ID of the CDO Object to look up.
We use the cdo view and CDOIDUtil function to retrieve the CDOObject:
CDOView view = getView() // returns the CDO View
CDOObject object = view.getObject(CDOIDUtil.createLong(cdoIdToRetrieve));
However the synchronized long interning causes threads to block:
java.lang.Thread.State: BLOCKED (on object monitor)
at org.eclipse.emf.cdo.internal.common.id.CDOIDObjectLongImpl$LongInterner.intern(CDOIDObjectLongImpl.java:155)
- locked <0x0000000501c92598> (a org.eclipse.emf.cdo.internal.common.id.CDOIDObjectLongImpl$LongInterner)
at org.eclipse.emf.cdo.internal.common.id.CDOIDObjectLongImpl.create(CDOIDObjectLongImpl.java:133)
at org.eclipse.emf.cdo.common.id.CDOIDUtil.createLong(CDOIDUtil.java:243)
Are there any strategies to prevent the blocking? I understand the reasoning behind the intern call being synchronized, but not sure the best way to reduce thread blocking. Our need is just to retrieve the CDOObject from its ID.
Source code is here for CDOIDObjectLongImpl:
https://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectLongImpl.java
Thanks!
[Updated on: Tue, 15 March 2022 19:05] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02268 seconds