|
From: <jue...@we...> - 2004-05-31 15:03:42
|
I've done some quick googling, and found those related forum entries: =20 http://forum.java.sun.com/thread.jsp?thread=3D342767&forum=3D48&message=3D= 2018577 = <http://forum.java.sun.com/thread.jsp?thread=3D342767&forum=3D48&message=3D= 2018577>=20 http://coding.derkeiler.com/Archive/Java/comp.lang.java.databases/2003-10= /0156.html = <http://coding.derkeiler.com/Archive/Java/comp.lang.java.databases/2003-1= 0/0156.html>=20 http://www-106.ibm.com/developerworks/forums/dw_forum.jsp?forum=3D244&sta= rt=3D210&thRange=3D15&cat=3D10 = <http://www-106.ibm.com/developerworks/forums/dw_forum.jsp?forum=3D244&st= art=3D210&thRange=3D15&cat=3D10>=20 http://www.hibernate.org/56.html <http://www.hibernate.org/56.html>=20 So indeed Weblogic, WebSphere and OC4J seem to return special Connection = handles for Oracle - that are assignable to OracleConnection. = Nevertheless, we need to unwrap those for OracleLobHandler. You could configure your OracleLobHandler with Spring's = SimpleNativeJdbcExtractor: The latter uses a simple strategy of = retrieving the underlying Connection that should work with many pools = (namely, creating an empty java.sql.Statement and invoking getConnection = on it). For Spring 1.0.2, I've just changed SimpleNativeJdbcExtractor's strategy = (on the occasion of a comment in the Hibernate forum above): It attempts = to retrieve the underlying Connection via = conHandle.getMetaData().getConnection() now, which should work with even = more pools. I've also changed OracleLobHandler to use a SimpleNativeJdbcExtractor by = default, as the latter's new strategy should effectively work with = almost any connection pool (and a plain JDBC driver too). Note that OracleLobHandler just requires Connection unwrapping; For more = advanced usage of a NativeJdbcExtractor (for example with JdbcTemplate), = you still need specific NativeJdbcExtractor implementations for specific = connection pools. Juergen ________________________________ Von: spr...@li... im Auftrag = von j=FCrgen h=F6ller [werk3AT] Gesendet: Mo 31.05.2004 12:54 An: spr...@li... Betreff: Re: [Springframework-developer] re: OracleLobCreator OracleLobHandler needs to work on a native OracleConnection as it comes = from the driver. The usual problem in that respect is not the driver but = the connection pool: Every connection pool needs to wrap native = connections with pooled connections that at least have different closing = behavior. To address this, OracleLobHandler has the "nativeJdbcExtractor" = property, taking an implementation of Spring's NativeJdbcExtractor = interface. Spring includes out-of-the-box implementations for Commons = DBCP, XAPool, and JBoss. I guess what you need to do is write such an = extractor for Weblogic. What's odd about your exception is that OracleLobCreator does not = complain that it doesn't receive an OracleConnection (there's an = explicit check in there). It seems to get a wrapped connection that is = still assignable to OracleConnection, although it's not the native = OracleConnection from the driver... Maybe Weblogic uses some special way of pooling connections for the = Oracle driver, using poolable OracleConnections? The = getPhysicalConnection method will probably be in the OracleConnection = class, not in the CLOB class. Try writing a NativeJdbcExtractor that = unwraps an OracleConnection with that method. Juergen ________________________________ Von: spr...@li... im Auftrag = 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 = thin drivers (not weblogic ones) 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 = 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= a:5 090) > > at > oracle.jdbc.driver.OracleConnection.physicalConnectionWithin(OracleConnec= 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= :39 ) > > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl .java:25) > > at java.lang.reflect.Method.invoke(Method.java:324) > > at > org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.pr= epa reLob(OracleLobHandler.java:375) > > at > org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.cr= eat eLob(OracleLobHandler.java:327) > > at > org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.se= 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=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 ------------------------------------------------------- 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_id149&alloc_id=8166&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |