HHH-8310 : Lob proxy class loading problem

This commit is contained in:
Gail Badner 2014-07-09 19:31:50 -07:00
parent 4007655045
commit 365bfe99d8
5 changed files with 5 additions and 31 deletions

View File

@ -32,7 +32,6 @@ import java.sql.Blob;
import java.sql.SQLException; import java.sql.SQLException;
import org.hibernate.engine.jdbc.internal.BinaryStreamImpl; import org.hibernate.engine.jdbc.internal.BinaryStreamImpl;
import org.hibernate.internal.util.ClassLoaderHelper;
import org.hibernate.type.descriptor.java.DataHelper; import org.hibernate.type.descriptor.java.DataHelper;
/** /**
@ -195,11 +194,7 @@ public class BlobProxy implements InvocationHandler {
* @return The class loader appropriate for proxy construction. * @return The class loader appropriate for proxy construction.
*/ */
private static ClassLoader getProxyClassLoader() { private static ClassLoader getProxyClassLoader() {
ClassLoader cl = ClassLoaderHelper.getContextClassLoader(); return BlobImplementer.class.getClassLoader();
if ( cl == null ) {
cl = BlobImplementer.class.getClassLoader();
}
return cl;
} }
private static class StreamBackedBinaryStream implements BinaryStream { private static class StreamBackedBinaryStream implements BinaryStream {

View File

@ -33,7 +33,6 @@ import java.sql.Clob;
import java.sql.SQLException; import java.sql.SQLException;
import org.hibernate.engine.jdbc.internal.CharacterStreamImpl; import org.hibernate.engine.jdbc.internal.CharacterStreamImpl;
import org.hibernate.internal.util.ClassLoaderHelper;
import org.hibernate.type.descriptor.java.DataHelper; import org.hibernate.type.descriptor.java.DataHelper;
/** /**
@ -211,10 +210,6 @@ public class ClobProxy implements InvocationHandler {
* @return The class loader appropriate for proxy construction. * @return The class loader appropriate for proxy construction.
*/ */
protected static ClassLoader getProxyClassLoader() { protected static ClassLoader getProxyClassLoader() {
ClassLoader cl = ClassLoaderHelper.getContextClassLoader(); return ClobImplementer.class.getClassLoader();
if ( cl == null ) {
cl = ClobImplementer.class.getClassLoader();
}
return cl;
} }
} }

View File

@ -27,8 +27,6 @@ import java.io.Reader;
import java.lang.reflect.Proxy; import java.lang.reflect.Proxy;
import java.sql.NClob; import java.sql.NClob;
import org.hibernate.internal.util.ClassLoaderHelper;
/** /**
* Manages aspects of proxying java.sql.NClobs for non-contextual creation, including proxy creation and * Manages aspects of proxying java.sql.NClobs for non-contextual creation, including proxy creation and
* handling proxy invocations. We use proxies here solely to avoid JDBC version incompatibilities. * handling proxy invocations. We use proxies here solely to avoid JDBC version incompatibilities.
@ -82,10 +80,6 @@ public class NClobProxy extends ClobProxy {
* @return The class loader appropriate for proxy construction. * @return The class loader appropriate for proxy construction.
*/ */
protected static ClassLoader getProxyClassLoader() { protected static ClassLoader getProxyClassLoader() {
ClassLoader cl = ClassLoaderHelper.getContextClassLoader(); return NClobImplementer.class.getClassLoader();
if ( cl == null ) {
cl = NClobImplementer.class.getClassLoader();
}
return cl;
} }
} }

View File

@ -31,7 +31,6 @@ import java.lang.reflect.Proxy;
import java.sql.Blob; import java.sql.Blob;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.internal.util.ClassLoaderHelper;
/** /**
* Manages aspects of proxying {@link Blob Blobs} to add serializability. * Manages aspects of proxying {@link Blob Blobs} to add serializability.
@ -103,10 +102,6 @@ public class SerializableBlobProxy implements InvocationHandler, Serializable {
* @return The class loader appropriate for proxy construction. * @return The class loader appropriate for proxy construction.
*/ */
public static ClassLoader getProxyClassLoader() { public static ClassLoader getProxyClassLoader() {
ClassLoader cl = ClassLoaderHelper.getContextClassLoader(); return WrappedBlob.class.getClassLoader();
if ( cl == null ) {
cl = WrappedBlob.class.getClassLoader();
}
return cl;
} }
} }

View File

@ -31,7 +31,6 @@ import java.lang.reflect.Proxy;
import java.sql.Clob; import java.sql.Clob;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.internal.util.ClassLoaderHelper;
/** /**
* Manages aspects of proxying {@link Clob Clobs} to add serializability. * Manages aspects of proxying {@link Clob Clobs} to add serializability.
@ -102,10 +101,6 @@ public class SerializableClobProxy implements InvocationHandler, Serializable {
* @return The class loader appropriate for proxy construction. * @return The class loader appropriate for proxy construction.
*/ */
public static ClassLoader getProxyClassLoader() { public static ClassLoader getProxyClassLoader() {
ClassLoader cl = ClassLoaderHelper.getContextClassLoader(); return WrappedClob.class.getClassLoader();
if ( cl == null ) {
cl = WrappedClob.class.getClassLoader();
}
return cl;
} }
} }