• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Cannot create CLOB.createTemporary() in Sun One server

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to insert a Clob data into Oracle (9i) using thin driver. I used the sample code Oracle had suggested to insert Clob data (by creating temporary memory supplied by the driver). As a standalone program it works fine but when I deploy it to Sun One, it gives me a NullPointer exception in CLOB.createTemporary() method. The only difference I can see is, the database connnection used in standalone was Oracle.jdbc.driver.OracleConnection and that of the server was com.sun.enterprise.resource.JdbcXAConnection. Would this be an issue ? If so is their a work around ?
Thanks,
Srini
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did u get solution?

I am facing same problem
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
createTemporary expects an OracleConnection whereas from datasource we get a lite wrapper around OracleConnection. We need to navigate through the wrappers to get to the physical OracleConnection.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you are using oracle specific calls you would need to use their API calls.

You can check more details at:
http://swforum.sun.com/jive/thread.jspa?forumID=114&threadID=22440
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i've been arround with the same error and i've found the workarround.
BLOB tempBlob = BLOB.createTemporary(unwrappConnection(), true,BLOB.DURATION_CALL);
and the unwrappConnection() method
private OracleConnection unwrappConnection() throws SQLException {
org.jboss.resource.adapter.jdbc.WrappedConnection oWConn = (WrappedConnection) oConn;
return (OracleConnection) oWConn.getUnderlyingConnection();
}
and oConn is the connection taken from the datasource.
Hope this helps
Julian de Anquin
 
knowledge is the difference between drudgery and strategic action -- tiny ad
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic