On 26/05/2005 6:58 AM, Matt Hogstrom wrote:

I have a table (DB2 is the database) that has a Date column.  Here is the 
definition for the column:

c_since  date,

The correspondinig CMP field is a java.sql.Date.

I get the exception below when executing a finder Tx. I'm making the assumption that the problem is on the Date field. I'm interested in how this code works so if you can point me to the source so I can become a bit independent.
Thanks,

- Matt

15:45:55,685 WARN  [SystemExceptionInterceptor] CustomerEnt
javax.ejb.TransactionRolledbackLocalException
       at 
org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolicy.java:123)
       at 
org.openejb.transaction.TransactionContextInterceptor.invoke(TransactionContextInterceptor.java:80)
<snip>

Caused by: org.tranql.ql.QueryException: Error executing statement: SELECT 
C.C_ID, C.C_SINCE, C.C_BALANCE, C.C_CREDIT, C.C_CREDIT_LIMIT, C.C_YTD_PAYMENT, 
C.C_PHONE, C.C_ZIP, C.C_COUNTRY, C.C_STATE, C.C_CITY, C.C_STREET2, .C_STREET1, 
C.C_CONTACT, C.C_LAST, C.C_FIRST FROM C_CUSTOMER C WHERE C.C_ID = ?
       at org.tranql.sql.jdbc.JDBCQueryCommand.execute(JDBCQueryCommand.java:78)
JDBCQueryCommand is the first place to look at in order to confirm that the issue comes from the c_since field. As a matter of fact, we need to enhance JDBCQueryCommand to clearly identify the field which cannot be read.

       at org.tranql.cache.QueryFaultHandler.rowFault(QueryFaultHandler.java:53)
       at 
org.openejb.entity.cmp.CMPInstanceContext.associate(CMPInstanceContext.java:146)
       at 
org.apache.geronimo.transaction.context.AbstractTransactionContext.associate(AbstractTransactionContext.java:47)
       at 
org.apache.geronimo.transaction.context.AbstractTransactionContext.beginInvocation(AbstractTransactionContext.java:85)
       at 
org.openejb.entity.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:125)
       at 
org.openejb.entity.cmp.InTxCacheInterceptor.invoke(InTxCacheInterceptor.java:82)
       at 
org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolicy.java:119)
       ... 45 more
Caused by: com.ibm.db2.jcc.b.xd: Invalid data conversion: Wrong result column 
type for requested conversion.
       at com.ibm.db2.jcc.b.r.O(r.java:1281)
       at com.ibm.db2.jcc.b.rc.getBinaryStream(rc.java:918)
       at 
org.tranql.connector.jdbc.ResultSetHandle.getBinaryStream(ResultSetHandle.java:215)
       at org.tranql.sql.jdbc.binding.BlobBinding.getValue(BlobBinding.java:44)
       at 
org.tranql.sql.jdbc.binding.TypeConverterBinding.getValue(TypeConverterBinding.java:81)
       at 
org.tranql.sql.jdbc.binding.TypeConverterBinding.getValue(TypeConverterBinding.java:85)
       at org.tranql.sql.jdbc.JDBCQueryCommand.execute(JDBCQueryCommand.java:72)
       ... 52 more
org.tranql.sql.jdbc.binding.BindingFactory is the place to look at in order to understand why a BlobBinding is used to read the "faulty" field. The corresponding JUnit test, org.tranql.sql.jdbc.binding.BindingFactoryTest, may be helpful to support your investigations.

Also, if you send me your module, I will give it a try tonight.

Thanks,
Gianny

Reply via email to