mirror of https://github.com/apache/openjpa.git
Revert 'OPENJPA-1993:Deadlock Potential with ORM XML Processing' revision 1160278
git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/1.0.x@1176527 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8a81ee2d25
commit
43117f9e4d
|
@ -361,19 +361,14 @@ public abstract class XMLMetaDataParser extends DefaultHandler
|
|||
_sourceName = sourceName;
|
||||
SAXParser parser = null;
|
||||
ClassLoader oldLoader = null;
|
||||
ClassLoader overrideLoader = null;
|
||||
|
||||
try {
|
||||
if (_overrideContextClassloader == true) {
|
||||
|
||||
oldLoader = (ClassLoader) AccessController.doPrivileged(
|
||||
J2DoPrivHelper.getContextClassLoaderAction());
|
||||
|
||||
overrideLoader = XMLMetaDataParser.class.getClassLoader();
|
||||
AccessController.doPrivileged(J2DoPrivHelper.setContextClassLoaderAction(overrideLoader));
|
||||
|
||||
if (_log != null && _log.isTraceEnabled()) {
|
||||
_log.trace(_loc.get("override-contextclassloader-begin", oldLoader, overrideLoader));
|
||||
}
|
||||
AccessController.doPrivileged(J2DoPrivHelper.setContextClassLoaderAction(
|
||||
XMLMetaDataParser.class.getClassLoader()));
|
||||
}
|
||||
|
||||
parser = XMLFactory.getSAXParser(validating, true);
|
||||
|
@ -407,18 +402,16 @@ public abstract class XMLMetaDataParser extends DefaultHandler
|
|||
JavaVersions.initCause(ioe, se);
|
||||
throw ioe;
|
||||
} finally {
|
||||
if (_overrideContextClassloader == true) {
|
||||
if (_overrideContextClassloader == true && oldLoader != null) {
|
||||
// Restore the old ContextClassloader
|
||||
try {
|
||||
if (_log != null && _log.isTraceEnabled()) {
|
||||
_log.trace(_loc.get("override-contextclassloader-end", overrideLoader, oldLoader));
|
||||
}
|
||||
AccessController.doPrivileged(J2DoPrivHelper.setContextClassLoaderAction(oldLoader));
|
||||
} catch (Throwable t) {
|
||||
if (_log != null && _log.isWarnEnabled()) {
|
||||
_log.warn(_loc.get("restore-contextclassloader-failed"));
|
||||
if (_log != null && _log.isTraceEnabled()) {
|
||||
_log.trace(_loc.get("restore-contextclassloader-failed"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
|
|
|
@ -25,10 +25,6 @@ cant-diff-elems: Unable to differentiate between given package and class \
|
|||
elements for class arg parsing. No element can be a complete prefix of \
|
||||
another.
|
||||
class-arg: Error extracting class information from "{0}".
|
||||
override-contextclassloader-begin: Overriding thread context classloader \
|
||||
from "{0}" to "{1}".
|
||||
override-contextclassloader-end: Restoring thread context classloader \
|
||||
from "{0}" to "{1}".
|
||||
restore-contextclassloader-failed: An error occurred restoring the Thread's \
|
||||
context classloader.
|
||||
parse-error: An error was encountered while parsing element "{0}". Make sure \
|
||||
|
|
Loading…
Reference in New Issue