From fe45f77f038d058b28c4b667cf91e4e13161489f Mon Sep 17 00:00:00 2001 From: Michael Dick Date: Thu, 17 Apr 2008 18:41:25 +0000 Subject: [PATCH] OPENJPA-542 git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@649221 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/openjpa/jdbc/sql/OracleDictionary.java | 9 ++++++--- .../java/org/apache/openjpa/lib/util/J2DoPrivHelper.java | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java index 1a17e0232..f3e569c5b 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java @@ -20,6 +20,7 @@ package org.apache.openjpa.jdbc.sql; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.security.AccessController; import java.sql.Blob; import java.sql.Clob; import java.sql.Connection; @@ -45,9 +46,9 @@ import org.apache.openjpa.jdbc.schema.Index; import org.apache.openjpa.jdbc.schema.PrimaryKey; import org.apache.openjpa.jdbc.schema.Sequence; import org.apache.openjpa.jdbc.schema.Table; -import org.apache.openjpa.jdbc.sql.Select; import org.apache.openjpa.lib.jdbc.DelegatingDatabaseMetaData; import org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement; +import org.apache.openjpa.lib.util.J2DoPrivHelper; import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.util.StoreException; @@ -1002,7 +1003,8 @@ public class OracleDictionary return EMPTY_CLOB; try { return EMPTY_CLOB = (Clob) Class.forName("oracle.sql.CLOB",true, - Thread.currentThread().getContextClassLoader()). + AccessController.doPrivileged(J2DoPrivHelper + .getContextClassLoaderAction())). getMethod("empty_lob", new Class[0]). invoke(null, new Object[0]); } catch (Exception e) { @@ -1016,7 +1018,8 @@ public class OracleDictionary return EMPTY_BLOB; try { return EMPTY_BLOB = (Blob) Class.forName("oracle.sql.BLOB",true, - Thread.currentThread().getContextClassLoader()). + AccessController.doPrivileged(J2DoPrivHelper + .getContextClassLoaderAction())). getMethod("empty_lob", new Class[0]). invoke(null, new Object[0]); } catch (Exception e) { diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java index a9d9b4286..b4f807968 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java @@ -781,9 +781,9 @@ public abstract class J2DoPrivHelper { * * @return ClassLoader */ - public static final PrivilegedAction getContextClassLoaderAction() { - return new PrivilegedAction() { - public Object run() { + public static final PrivilegedAction getContextClassLoaderAction() { + return new PrivilegedAction() { + public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } };