4 Replies Latest reply on May 18, 2002 2:50 AM by Starco

    Error: "ORA-00972: identifier is too long" for CMP CMR JBoss

    Starco Newbie

      Hello all.

      I use JBoss 3.0 RC2 and Oracle9i. The error occurs for JBoss 3.0 RC1 too.

      I have 2 bean and 2 unidirectional relationships beween them. First relationship is one-many, second - one-one. The one bean has two foreing key columuns to another bean.
      The beans have deployed succesful. But during work (when tthere are invoked the select methods that use one-one relationships ) the server throws java.sql.SQLException: ORA-00972: identifier is too long. The SQL statement (from server.log):
      SELECT cboIdentity, defId, BOAgrigationEnrollmentBean_agrregatedBOEntity_agregatedBOID, BOAgrigationEnrollmentBean_agrregatedBOEntity_businessObjectID FROM BORCBO WHERE (cboId=?)
      Two colum names are very strange for me:
      BOAgrigationEnrollmentBean_agrregatedBOEntity_agregatedBOID and BOAgrigationEnrollmentBean_agrregatedBOEntity_businessObjectID
      The server think that one of the tables (table "BorCbo") has in data base these columns. But they doesn't exist here.

      It seems, these strange columns form by pattern: ejb-name-of-relationship-role-source_cmr-field-name_cmp-filed-for-fk.
      Example:
      ejb-name-of-relationship-role-source = BOAgrigationEnrollmentBean
      cmr-field-name = agrregatedBOEntity
      cmp-filed-for-fk = agregatedBOID (or businessObjectID)

      Why JBoss think that there columns exist in table?



      ==========================================================
      The database details:
      I have two tables between which I have 2 relationhips.
      1. table BorCbo with columns
      cboId - pk
      identity
      defId

      2. table BorAgrigation with columns
      cboId - fk to table BorCbo
      agrigatedCboId - fk to table BorCbo
      agrIdentifier
      agrNumber
      There are 2 foreing keys to table BorCbo. The first foring key "cboId" is used by one-many relationships with ejb-relation-name "BOEntityBean.agrigationEnrollment-BOAgrigationEnrollmentBean".
      The second "agrigatedCboId" is used by one-one relationships with ejb-relation-name "ArgregationBORelationship".
      ==========================================================



      ==========================================================
      The ejb details.
      1. The entity bean BOEntityBean works with table BorCbo. There exist 2 cmp-fields (mapped in bosscmp-jdbc.xml):
      businessObjectID for cboId
      identity for identity
      And 1 cmr-field agrigationEnrollment for one-to-many relationships "BOEntityBean.agrigationEnrollment-BOAgrigationEnrollmentBean". This relation is described from BOEntityBean side as:
      <key-fields>
      <key-field>
      <field-name>businessObjectID</field-name>
      <column-name>cboId</column-name>
      </key-field>
      </key-fields>

      2. The entity bean BOAgrigationEnrollmentBean works with table BorAgrigation There exist 4 cmp-fields (mapped in bosscmp-jdbc.xml):
      businessObjectID for cboId
      number for agrNumber
      agregatedBOIdentifier for agrIdentifier
      agregatedBOID for agrigatedCboId
      And 1 cmr-field agrregatedBOEntity for one-to-one relationship "ArgregationBORelationship". This relation is described from BOEntityBean side as:
      <key-fields>
      <key-field>
      <field-name>businessObjectID</field-name>
      <column-name>agrigatedCboId</column-name>
      </key-field>
      </key-fields>
      ==========================================================



      ==========================================================
      server.log details:
      I have checked server.log file and found only 2 encountered entries with strange columns.
      1. 2002-05-17 10:55:34,342 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.BOEntityBean] Insert Entity SQL: INSERT INTO BORCBO (cboId, cboIdentity, defId, BOAgrigationEnrollmentBean_agrregatedBOEntity_agregatedBOID, BOAgrigationEnrollmentBean_agrregatedBOEntity_businessObjectID) VALUES (?, ?, ?, ?, ?)

      2. 2002-05-17 10:55:57,084 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.BOEntityBean] Executing SQL: SELECT cboIdentity, defId, BOAgrigationEnrollmentBean_agrregatedBOEntity_agregatedBOID, BOAgrigationEnrollmentBean_agrregatedBOEntity_businessObjectID FROM BORCBO WHERE (cboId=?)
      2002-05-17 10:55:57,125 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException, causedBy:
      java.sql.SQLException: ORA-00972: identifier is too long

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
      at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
      at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
      at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1451)
      at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:651)
      at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2117)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2331)
      at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:422)
      at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:366)
      at org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeQuery(LocalPreparedStatement.java:289)
      ...
      ==========================================================



      P.S. My beans wotk fine on Weblogic6.1/7.0. May be I have bug in jbosscmp-jdbc.xml...

      Thanks in advance.