0 Replies Latest reply on Oct 7, 2003 8:59 AM by pkrishna

    unknown-pk configuration for PK

    pkrishna

      I am configuring jbosscmp-jdbc.xml to support for unknown-pk and I am having difficulties with it. I have two ejbs which are related through CMR. One of them has a known PK while the other has unknown-pk. After doing some research on the web, I have come up with the following snippet in the jbosscmp-jdbc.xml:

      <unknown-pk>
      <unknown-pk-class>java.lang.Integer</unknown-pk-class>
      <field-name>id</field-name>
      <column-name>id</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>INTEGER</sql-type>
      <auto-increment/>
      </unknown-pk>
      <entity-command name="get-generated-keys"
      class="org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBC30GeneratedKeysCreateCommand"/>

      This is within the tag.

      When one of the EJBs goes to create the other EJB I get the following exception:

      2003-10-06 11:56:26,447 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.AddressBean] Could not create entity
      org.firebirdsql.jdbc.FBSQLException: GDS Exception. validation error for column ADDRESSBEAN_UPK, value "*** null ***"
      at org.firebirdsql.jdbc.FBPreparedStatement.internalExecute(FBPreparedStatement.java:458)
      at org.firebirdsql.jdbc.FBPreparedStatement.executeUpdate(FBPreparedStatement.java:130)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:308)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.executeInsert(JDBCAbstractCreateCommand.java:366)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:327)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:143)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:575)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:208)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:269)
      at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:580)

      I am currently using firebird driver pointing to an interbase database.

      Could somebody help me out?