openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r649224 - /openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
Date Thu, 17 Apr 2008 18:42:35 GMT
Author: mikedd
Date: Thu Apr 17 11:42:33 2008
New Revision: 649224

URL: http://svn.apache.org/viewvc?rev=649224&view=rev
Log:
OPENJPA-575

Modified:
    openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java

Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=649224&r1=649223&r2=649224&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
(original)
+++ openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
Thu Apr 17 11:42:33 2008
@@ -20,6 +20,7 @@
 
 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;
@@ -47,8 +48,10 @@
 import org.apache.openjpa.jdbc.schema.Table;
 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;
+
 import serp.util.Numbers;
 
 /**
@@ -1011,11 +1014,11 @@
         if (EMPTY_CLOB != null)
             return EMPTY_CLOB;
         try {
-            return EMPTY_CLOB =
-                    (Clob) Class.forName("oracle.sql.CLOB", true,
-                            Thread.currentThread().getContextClassLoader())
-                            .getMethod("empty_lob", new Class[0]).invoke(null,
-                                    new Object[0]);
+            return EMPTY_CLOB = (Clob) Class.forName("oracle.sql.CLOB", true,
+                    (ClassLoader) AccessController.doPrivileged(J2DoPrivHelper
+                            .getContextClassLoaderAction()))
+                .getMethod("empty_lob", new Class[0]).
+                invoke(null, new Object[0]);
         } catch (Exception e) {
             throw new SQLException(e.getMessage());
         }
@@ -1027,7 +1030,8 @@
             return EMPTY_BLOB;
         try {
             return EMPTY_BLOB = (Blob) Class.forName("oracle.sql.BLOB", true,
-                    Thread.currentThread().getContextClassLoader()).
+                    (ClassLoader) AccessController.doPrivileged(J2DoPrivHelper
+                            .getContextClassLoaderAction())).
                 getMethod("empty_lob", new Class[0]).
                 invoke(null, new Object[0]);
         } catch (Exception e) {



Mime
View raw message