| Summary: | Potential deadlock when using fetch joins | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Tom Ware <tom.ware> | ||||||||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||||||||
| Severity: | normal | ||||||||||||||
| Priority: | P3 | CC: | christopher.delahunt, michael.f.obrien | ||||||||||||
| Version: | unspecified | ||||||||||||||
| Target Milestone: | --- | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Windows XP | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Tom Ware
Created attachment 178181 [details]
Potential fix
Attached a potential fix which cascades the deferred locking settings to object builds for fetch joins. The deadlock occurs in the following situation - Bidirectional relationship between A and B - B has no EAGER ForeignReferenceMappings and, hence, will use Active Locking by default - A->B is EAGER - B->A is LAZY - Query1 is ReadObjectQuery for A - Query 2 is ReadObjectQuery for B with a fetch join to A - Run Query 1 and stop it after it gets the lock for A, but before it gets the lock for B - Run Query 2 - Allow Query 1 to continue Query 1 will deadlock when it tries to get an active lock for A. Created attachment 179147 [details]
Suggested fix with test case
The attached fix cascades deferred locking settings for any object that uses deferred locking to any additional EAGER or Joined attributes retrieved by the same query. Created attachment 179381 [details]
Updated patch
Created attachment 179400 [details]
Updated patch
Fixed in trunk. Reviewed by James Sutherland and Gordon Yorke Added test to simultaneous test model Fix also checked into 2.1.2 Completed: At revision: 8437 Created attachment 182037 [details]
Updated patch on 2.1.2 stream
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |