JPA: Exception saving CLOB

2009-01-09 Thread fishchips

I try to save data in the oracle CLOB field. I declared a field in my Entity
bean: 
 @Lob private String data;  
Ther#s not much to do wrong, isn't it?  But I have an exception thrown:

Caused by: 
org.apache.openjpa.persistence.PersistenceException: oracle.sql.CLOB in
classloader org.apache.geronimo.configs/openjpa/2.1.1/car
at
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:3946)
at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:97)
at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:83)
at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:59)
at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:75)
at
org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flushPrimaryRow(OperationOrderUpdateManager.java:203)
at
org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flush(OperationOrderUpdateManager.java:89)
at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
at
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
... 37 more
Caused by: java.sql.SQLException: oracle.sql.CLOB in classloader
org.apache.geronimo.configs/openjpa/2.1.1/car
at
org.apache.openjpa.jdbc.sql.OracleDictionary.getEmptyClob(OracleDictionary.java:1016)
at
org.apache.openjpa.jdbc.sql.OracleDictionary.setNull(OracleDictionary.java:514)
at
org.apache.openjpa.jdbc.sql.DBDictionary.setTyped(DBDictionary.java:1090)
at org.apache.openjpa.jdbc.sql.RowImpl.flush(RowImpl.java:888)
at org.apache.openjpa.jdbc.sql.RowImpl.flush(RowImpl.java:848)
at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:95)
at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)

What's wrong about it?
-- 
View this message in context: 
http://www.nabble.com/JPA%3A-Exception-saving-CLOB-tp21369295s134p21369295.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



How to get OracleConnection from oracle.jdbc.driver.T4CConnection?

2009-01-09 Thread fishchips

We have Geronimo AS 2.1 with a datasource configured for an oracle 11
database.

This datsasource is used in an MDB:
@Resource(name="jdbc/SOAP_LOGG_NRDS") private DataSource ds;
...
Connection conn=ds.getConnection();

getAssociation() on this connecton returns a
org.tranql.connector.jdbc.ManagedJDBCConnection.
Calling getPhysicalConnection() on MenagedJDBCConnection I get
oracle.jdbc.driver.T4CConnection.
( Interestingly, I  only can call getAssociation and getPhysicalConnection
using reflection.
Casting like
  OracleConnection oraConnection2 = (OracleConnection)
((ConnectionHandle) conn).getAssociation().getPhysicalConnection();
results in ClasscastException. )

What I actually need is an OracleConnection to pass into
CLOB.createTemporary() or something like this.

How can I cast this connection to OracleConnection?

Or how can I configure a datasource to make it return me something
compatible with OracleConnection?
-- 
View this message in context: 
http://www.nabble.com/How-to-get-OracleConnection-from-oracle.jdbc.driver.T4CConnection--tp21368519s134p21368519.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.