From: Meyer-Willner, B. <Ber...@lo...> - 2003-05-08 15:33:26
|
Hi, we're using JBoss 3.0.5 CMP with Sybase SQL Anywhere 9 using JDBC = driver jConnect 5.5. We have CMP entity beans with fields named dsVersion of = type java.lang.Long. We didn't change the default Sybase typemapping in standardjbosscmp-jdbc.xml which is the following for Long: <mapping> <java-type>java.lang.Long</java-type> <jdbc-type>NUMERIC</jdbc-type> <sql-type>NUMERIC(38,0)</sql-type> </mapping> The corresponding columns in the DB tables are also of type = NUMERIC(38,0). Now if we try saving an entity which has such a field we're getting the following stacktrace showing the following SQLException from the JDBC driver: JZ0SE: Invalid object type (or null object) for setObject(). Turning on the TRACE log level reveals the stacktrace at the bottom of = the email. JBoss treats this field as jdbcType=3DBIGINT which results in an SQLException. On Oracle 8 the same works just fine (using the default Oracle8 mapping for java.lang.Long). With Oracle JBoss also treats the = field in question as jdbcType=3DBIGINT. We're really at a total loss here. As you can see above the jdbc type = for Long is declared as NUMERIC for Sybase and it's BIGINT for Oracle. Apparently mapping Long fields with the default mapping doesn't work at = all. Please help! Thanks so much, Bernie Stacktrace: 2003-05-08 17:18:40,502 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AkqStamm.dSV= ersi on] Set parameter: index=3D4, jdbcType=3DBIGINT, value=3D1000 2003-05-08 17:18:40,502 ERROR [org.jboss.ejb.GlobalTxEntityMap] Store = failed on entity: 3a224dd641944fe0bf9f887e9d33687a javax.ejb.EJBException: Internal error setting parameters for field dSVersion; CausedByException is: JZ0SE: Ung=FCltiger Objekttyp (oder Null-Objekt) f=FCr setObject() angegeben. at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setArgu= ment Parameters(JDBCAbstractCMPFieldBridge.java:297) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setInst= ance Parameters(JDBCAbstractCMPFieldBridge.java:270) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreE= ntit yCommand.java:85) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreMan= ager .java:589) at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceMa= nage r.java:458) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEn= tity (CachedConnectionInterceptor.java:388) at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:708) at org.jboss.ejb.GlobalTxEntityMap.syncEntities(GlobalTxEntityMap.java:117)= at org.jboss.ejb.GlobalTxEntityMap$GlobalTxEntityMapCleanup.beforeCompletio= n(Gl obalTxEntityMap.java:185) at org.jboss.tm.TxCapsule.doBeforeCompletion(TxCapsule.java:1394) at org.jboss.tm.TxCapsule.commit(TxCapsule.java:364) at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:73) ... This=20e-mail=20and=20any=20attachment=20is=20for=20authorised=20use=20by=20= the=20intended=20recipient(s)=20only.=20=20It=20may=20contain=20proprietar= y=20material,=20confidential=20information=20and/or=20be=20subject=20to=20= legal=20privilege.=20=20It=20should=20not=20be=20copied,=20disclosed=20to,= =20retained=20or=20used=20by,=20any=20other=20party.=20=20If=20you=20are=20= not=20an=20intended=20recipient=20then=20please=20promptly=20delete=20this= =20e-mail=20and=20any=20attachment=20and=20all=20copies=20and=20inform=20t= he=20sender.=20=20Thank=20you. |