Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318215 - SDO: HelperContext lookup issues with non-WLS owned thread
Summary: SDO: HelperContext lookup issues with non-WLS owned thread
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: David McCann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-28 13:12 EDT by David McCann CLA
Modified: 2022-06-09 10:06 EDT (History)
0 users

See Also:


Attachments
Proposed fix for 2.1.1 (1.78 KB, patch)
2010-06-28 13:20 EDT, David McCann CLA
no flags Details | Diff
Proposed fix for 2.0 (1.78 KB, patch)
2010-06-28 13:25 EDT, David McCann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David McCann CLA 2010-06-28 13:12:44 EDT
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.
Comment 1 David McCann CLA 2010-06-28 13:20:55 EDT
Created attachment 172931 [details]
Proposed fix for 2.1.1
Comment 2 David McCann CLA 2010-06-28 13:25:55 EDT
Created attachment 172932 [details]
Proposed fix for 2.0
Comment 3 David McCann CLA 2010-06-28 13:35:15 EDT
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'
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:06:10 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink