| Summary: | Deadlock exists during merge of related object | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Gordon Yorke <gordon.yorke> | ||||
| Component: | Eclipselink | Assignee: | Gordon Yorke <gordon.yorke> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P2 | CC: | eclipselink.foundation-inbox | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 166644 [details]
Patch
This patch contains a couple fixes. One is to insure we only check for invalidation if the ChangeSet has changes and therfore is already locked. As well MergeManager.updateCacheKeyProperties has also been updated to ensure it only operates if it is able to obtain a lock. This lock is also non-blocking.
Checked in http://fisheye2.atlassian.com/changelog/eclipselink/trunk?cs=7120 reviewed by Andrei Ilitchev Not checked in code does not include the changes to the UOW in the patch. These changes were included in the patch by mistake. The above comment should say "Note, checked in code ..." The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
The MergeManager checks to see if it should invalidate an Entity even when the MergeManager does not actually merge anything into the object. Second, shouldInvalidate assumes that it has the lock for the CacheKey when the object being merged may not have changes but may only be referenced and in this case the MergeManager will not have the locks for this object and will be stuck waiting on the lock. The scenario is as Follows: A has OneToOne to B thread-1 acquires a deferred lock on B1 thread-2 A1 is set to reference B1 thread-2 commits thread-2 merge locks A1 thread-2 attempts to get lock on B1 but cannot so transitions to deferred and gets a deferred lock on B1 thread-1 acquires deferred lock on A1 thread-2 merges B1 without checking for changes thread-2 attempts shouldInvalidate and acquire lock on B1 but must wait thread-1 unable to release deferred locks while thread-2 waits.