|
From: <jue...@we...> - 2004-05-31 20:30:52
|
Note that read access with OracleLobHandler does not need an unwrapped =
Connection; just write access via OracleLobCreator does.
=20
I've just decided to remove SimpleNativeJdbcExtractor as the =
OracleLobHandler default again, as it might be unwanted behavior if the =
pool offers handles that mirror the native Connections. There's a clear =
recommendation in the javadocs, though, particularly with respect to =
SimpleNativeJdbcExtractor's new strategy which should work with almost =
any connection pool.
=20
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von tho...@tr...
Gesendet: Mo 31.05.2004 21:35
An: spr...@li...
Betreff: Re: [Springframework-developer] re: OracleLobCreator
It looks to me that the WebLogic connection wrapper works fine. No need =
to
extract the native Oracle driver.
My connection is
"weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_OracleConnection=
"
I remember hearing some Bea guys mentioning that they added LOB =
functionality to
their wrapper.
I'm using WLS 8.1 SP2 that comes with the Oracle ojdbc14.jar (<Driver =
Version is
9.2.0.3.0>).
This code ran just fine using Spring 1.0.1 jar:
conn =3D ds.getConnection();
lh =3D new OracleLobHandler();
ps =3D conn.prepareStatement("select text from docs where doc_id =
=3D 1");
rs =3D ps.executeQuery();
if (rs.next()) {
clobText =3D lh.getClobAsString(rs, 1);
}
System.out.println("***> READ TEXT <*** length is " +
clobText.length());
There must me something else going on. I would make sure to check that =
the
ojdbc14.jar that comes with WLS81 SP2 is the one that is on the =
classpath for
the server. Could it be something in the transaction management that
interferes?
Thomas
Quoting "j=FCrgen h=F6ller [werk3AT]" <jue...@we...>:
> OracleLobHandler needs to work on a native OracleConnection as it =
comes =3D
> from the driver. The usual problem in that respect is not the driver =
but =3D
> the connection pool: Every connection pool needs to wrap native =3D
> connections with pooled connections that at least have different =
closing =3D
> behavior.
> =3D20
> To address this, OracleLobHandler has the "nativeJdbcExtractor" =3D
> property, taking an implementation of Spring's NativeJdbcExtractor =3D
> interface. Spring includes out-of-the-box implementations for Commons =
=3D
> DBCP, XAPool, and JBoss. I guess what you need to do is write such an =
=3D
> extractor for Weblogic.
> =3D20
> What's odd about your exception is that OracleLobCreator does not =3D
> complain that it doesn't receive an OracleConnection (there's an =3D
> explicit check in there). It seems to get a wrapped connection that is =
=3D
> still assignable to OracleConnection, although it's not the native =3D
> OracleConnection from the driver...
> =3D20
> Maybe Weblogic uses some special way of pooling connections for the =
=3D
> Oracle driver, using poolable OracleConnections? The =3D
> getPhysicalConnection method will probably be in the OracleConnection =
=3D
> class, not in the CLOB class. Try writing a NativeJdbcExtractor that =
=3D
> unwraps an OracleConnection with that method.=3D20
> =3D20
> Juergen
> =3D20
>
> ________________________________
>
> Von: spr...@li... im Auftrag =
=3D
> von Bronwen Cassidy
> Gesendet: Mo 31.05.2004 04:27
> An: spr...@li...
> Betreff: RE: [Springframework-developer] re: OracleLobCreator
>
>
>
> Hi I have:
>
> Weblogic 8 service pack 2
> ojdbc.jar (Oracle9i 9.2.0.1 JDBC Drivers)
> Oracle9i
> I have set up the connection pool using the jdbc:oracle:thin (oracle =
=3D
> thin
> drivers (not weblogic ones)=3D20
>
> Actually I managed to find some information (very little) one from a
> hibernate mail, suggested using the getPhysicalConnection() instead of
> createTemporary, but this method does not seem to available on the =
CLOB
> class??
>
> -----Original Message-----
> From: spr...@li...
> [mailto:spr...@li...] On =
Behalf =3D
> Of
> Thomas Risberg
> Sent: 31 May 2004 02:09
> To: spr...@li...
> Subject: Re: [Springframework-developer] re: OracleLobCreator
>
> Bronwen,
>
> In order to pinpoint the problem quicker - what version of WebLogic,
> Oracle and JDBC drivers are you using?
>
> Thomas
>
> Bronwen Cassidy wrote:
>
> > Hi I have a CLOB column in oracle and in the test there are no
> > problems, unfortunately deploying to weblogic I get the exception
> > below. We are using classes12.jar whereas weblogic uses ojdbc14.jar, =
I
> > firstly replaced weblogics jars and classpath settings to use the
> > classes12.jar, but got the same error, so I pulled weblogic oracle =
jar
> > into my test classpath to test if the problem was with the jars but
> > the test worked fine ?? I am really stuck as to whom this should go =
to
> > weblogic, oracle, or . I am hoping there is an expert there who can
> > shed some light. Google did not have a single match for variations =
of
> > the first 2 lines!!
> >
> > java.lang.ClassCastException
> >
> > at
> >
> =
oracle.jdbc.driver.OracleConnection.unwrapCompletely(OracleConnection.jav=
=3D
> a:5
> 090)
> >
> > at
> >
> =
oracle.jdbc.driver.OracleConnection.physicalConnectionWithin(OracleConnec=
=3D
> tio
> n.java:5141)
> >
> > at oracle.sql.CLOB.createTemporary(CLOB.java:1009)
> >
> > at oracle.sql.CLOB.createTemporary(CLOB.java:956)
> >
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >
> > at
> >
> =
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java=
=3D
> :39
> )
> >
> > at
> >
> =
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI=
=3D
> mpl
> .java:25)
> >
> > at java.lang.reflect.Method.invoke(Method.java:324)
> >
> > at
> >
> =
org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.pr=
=3D
> epa
> reLob(OracleLobHandler.java:375)
> >
> > at
> >
> =
org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.cr=
=3D
> eat
> eLob(OracleLobHandler.java:327)
> >
> > at
> >
> =
org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.se=
=3D
> tCl
> obAsString(OracleLobHandler.java:255)
> >
> > thank-you for any help
> >
> > Bronwen
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle =
10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3D3D3149&alloc_id=3D3D8166&op=3D3Dclick
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle =
10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3D3D3149&alloc_id=3D3D8166&op=3D3Dclick
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle =
10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|