Just changed it into a post-invocation ClassCastException check.
Unfortunately, I haven't any Oracle installation around here, so it would be
great if someone could give this a try. The change to OracleLobHandler is
already committed to CVS HEAD.
Juergen
_____
From: Juergen Hoeller [mailto:ju...@in...]
Sent: Sunday, October 02, 2005 11:21 PM
To: 'spr...@li...'
Subject: RE: [Springframework-developer] OracleLobHandler on WebSphere 6.0
Actually, the Connection implementation class could be some wrapper whose
name doesn't start with "oracle.jdbc." but which is still assignable to
"oracle.jdbc.OracleConnection"... So I guess we can't use that check.
However, loading the OracleConnection class every time a LOB is accessed
isn't desirable either, even if the Connection handle's class loader would
guarantee proper loading.
Hmm, we could simply not do any explicit check and pass the Connection into
BLOB/CLOB.createTemporary. If a ClassCastException arises, we'll convert
into our nice exception saying "please specify a NativeJdbcExtractor". That
might be a feasible compromise...
Juergen
_____
From: Juergen Hoeller [mailto:ju...@in...]
Sent: Sunday, October 02, 2005 11:15 PM
To: 'spr...@li...'
Subject: Re: [Springframework-developer] OracleLobHandler on WebSphere 6.0
Yes... but I guess checking for the name starting with "oracle.jdbc." would
be fine. It's just about checking whether the passed-in Connection has any
chance of getting accepted by CLOB.createTemporary(con, ...) so we don't
really need a full type check there - just a basic sanity check.
Juergen
_____
From: spr...@li...
[mailto:spr...@li...] On Behalf Of
Thomas Risberg
Sent: Sunday, October 02, 2005 11:10 PM
To: spr...@li...
Subject: Re: [Springframework-developer] OracleLobHandler on WebSphere 6.0
We could also use the classloader for the connection to load any classes
used for testing and for reflection - like
conToUse.getClass().getClassLoader().loadClass(CONNECTION_CLASS_NAME);
Thomas
On Oct 2, 2005, at 4:58 PM, Thomas Risberg wrote:
On Oct 2, 2005, at 4:43 PM, Juergen Hoeller wrote:
So our OracleLobHandler works on the new "oracle.jdbc.Connection" interface,
while WebSphere seems to return an "oracle.jdbc.driver.Connection" that's
not assignable to the "oracle.jdbc.Connection" interface.
The class we test for is:
private static final String CONNECTION_CLASS_NAME =
"oracle.jdbc.OracleConnection";
In my tests any Oracle connection is assignable to this class as long as
they both come from the same classloader.
Seems like the test is the problem here - maybe we should just test for a
class name that starts with "oracle.jdbc"
Thomas
|