[master] New eclipselink dead lock scenario ... enhancement and unit test #2350
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2094
This is enhancement for case of possible deadlock which should happens in
org.eclipse.persistence.internal.sessions.AbstractSession#getCacheKeyFromTargetSessionForMerge
method if usedorg.eclipse.persistence.internal.identitymaps.CacheKey
instance is locked by another thread.There is new system or persistence property
eclipselink.concurrency.manager.allow.getcachekeyformerge.mode
which can controlorg.eclipse.persistence.internal.sessions.AbstractSession#getCacheKeyFromTargetSessionForMerge
logic to getorg.eclipse.persistence.internal.identitymaps.CacheKey
instance and object value behind this.There are two allowed values:
ORIGIN
(DEFAULT) - There is infinitejava.lang.Object.wait()
call in case of some conditions during time when object/entity referred fromorg.eclipse.persistence.internal.identitymaps.CacheKey
is locked and modified by another thread. In some cases it should leads into deadlock.WAITLOOP
- Merge manager will try in the loop with timeout waitcacheKey.wait(ConcurrencyUtil.SINGLETON.getAcquireWaitTime());
fetch object/entity fromorg.eclipse.persistence.internal.identitymaps.CacheKey
. If fetch will be successful object/entity loop finish and continuewith remaining code. If not
java.lang.InterruptedException
is thrown and caught and usedorg.eclipse.persistence.internal.identitymaps.CacheKey
instance status is set into invalidation state. This strategy avoid deadlock issue, but there should be impact to the performance.