0 Replies Latest reply on Apr 26, 2003 2:51 PM by Christoph Winkler

    JBOSS 3.2.0, Oracle 8.1.7 and JDBCPkSqlCreateCommand

    Christoph Winkler Newbie

      I have problems using the pk-sql entity command to support auto-generated keys with Oracle sequence.
      The JDBCPkSqlCreateCommand gets the correct new key, but fails during verification ->

      2003-04-26 19:17:43,927 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCPkSqlCreateCommand.Person] Executing SQL: SELECT PERSON_SEQ.NEXTVAL FROM DUAL
      2003-04-26 19:17:43,978 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCPkSqlCreateCommand.Person] Create: pk=11
      2003-04-26 19:17:43,979 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCPkSqlCreateCommand.Person] Executing SQL: SELECT COUNT(*) FROM PERSON WHERE ObjectIdentity=?
      2003-04-26 19:17:43,980 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCPkSqlCreateCommand.Person] Error checking if entity exists
      java.lang.ClassCastException
      at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:1974)
      at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2052)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.setObject(WrappedPreparedStatement.java:607)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.setParameter(JDBCUtil.java:280)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setArgumentParameters(JDBCAbstractCMPFieldBridge.java:301)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setPrimaryKeyParameters(JDBCAbstractCMPFieldBridge.java:289)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.setPrimaryKeyParameters(JDBCEntityBridge.java:642)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.entityExists(JDBCCreateEntityCommand.java:202)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCPkSqlCreateCommand.execute(JDBCPkSqlCreateCommand.java:121)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:569)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:225)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270)
      at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:571)


      I am using the following components:
      - JBOSS 3.2.0
      - JRE 1.4.1
      - Oracle 8.1.7
      - JDBC Driver classes12.zip

      Anyone has a solution for that problem?

      Christoph