| Summary: | SDO: HelperContext lookup issues with non-WLS owned thread | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | David McCann <david.mccann> | ||||||
| Component: | Eclipselink | Assignee: | David McCann <david.mccann> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | ||||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 172931 [details]
Proposed fix for 2.1.1
Created attachment 172932 [details]
Proposed fix for 2.0
Reviewed by: matt.macivor@oracle.com Tests: all unit tests pass as expected; all server tests pass as expected Fix checked into 2.1.1 and 2.2 NOTE: patch file 'Proposed fix for 2.0' should be named 'Proposed fix for 2.2' The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
The is a scenario in which the first lookup occurs in a WLS owned thread, where we get the app name and use that as the key. Later on the lookup is performed in a non-WLS owned thread, so we cannot get the app name... the loaders, however, are the same so we can lookup based on it. In the equals method of HelperContexMapKey we need to check for application name equality as well as class loader equality, i.e.: ... // if the applicationName is non-null we will base equality on it if (applicationName != null) { return this.applicationName.equals(ckey.getApplicationName()) || areLoadersEqual(ckey.getLoader()); } // at this point we have to assume that the class loader is the map key, so base equality on it return areLoadersEqual(ckey.getLoader()); ... We will also need to make the hashCode method return a consistent value NOT based on app name or class loader.