6 Replies Latest reply on May 13, 2002 6:10 PM by dsundstrom

    One more CMR bug?

    starco

      Hello.

      My application throws exception (a part from server.log):
      2002-05-02 17:50:18,415 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.BOEntityBean] Executing SQL: SELECT identity, BOAgrigationEnrollmentBean_agrregatedBOEntity_agregatedBOID, BOAgrigationEnrollmentBean_agrregatedBOEntity_businessObjectID, defId FROM BORCBO WHERE (cboId=?)
      2002-05-02 17:50:18,475 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.PreparedStatementInPool.executeQuery(PreparedStatementInPool.java:862)
      ...

      Two colum names are very strange for me:
      BOAgrigationEnrollmentBean_agrregatedBOEntity_agregatedBOID and BOAgrigationEnrollmentBean_agrregatedBOEntity_businessObjectID
      The table in db does not contains these colums. But JBoss thinks that they exist.

      my standardjbosscmp-jdbc.xml:
      ...

      java:/bo.ds
      <datasource-mapping>Oracle9i</datasource-mapping>
      <create-table>false</create-table>
      <remove-table>false</remove-table>
      <read-only>false</read-only>
      <time-out>300</time-out>
      <pk-constraint>true</pk-constraint>
      <fk-constraint>false</fk-constraint>
      <row-locking>false</row-locking>
      <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
      <read-ahead>
      on-load
      <page-size>1000</page-size>
      <eager-load-group>*</eager-load-group>
      </read-ahead>
      <list-cache-max>1000</list-cache-max>

      ...

      my ejb-jar.xml
      ....

      <display-name>BOEntityBean</display-name>
      <ejb-name>BOEntityBean</ejb-name>
      <local-home>de.dts.businessobject.registry.impl.BOEntityLocalHome</local-home>
      de.dts.businessobject.registry.impl.BOEntityLocal
      <ejb-class>de.dts.businessobject.registry.impl.BOEntityBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>BOEntity</abstract-schema-name>
      <cmp-field>
      no description
      <field-name>businessObjectID</field-name>
      </cmp-field>
      <cmp-field>
      no description
      <field-name>identity</field-name>
      </cmp-field>
      <primkey-field>businessObjectID</primkey-field>
      ....

      <display-name>BOAgrigationEnrollmentBean</display-name>
      <ejb-name>BOAgrigationEnrollmentBean</ejb-name>
      <local-home>de.dts.businessobject.registry.impl.BOAgrigationEnrollmentLocalHome</local-home>
      de.dts.businessobject.registry.impl.BOAgrigationEnrollmentLocal
      <ejb-class>de.dts.businessobject.registry.impl.BOAgrigationEnrollmentBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>de.dts.businessobject.registry.impl.BOAgrigationEnrollmenPk</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>BOAgrigationEnrollment</abstract-schema-name>
      <cmp-field>
      no description
      <field-name>businessObjectID</field-name>
      </cmp-field>
      <cmp-field>
      no description
      <field-name>number</field-name>
      </cmp-field>
      <cmp-field>
      no description
      <field-name>agregatedBOIdentifier</field-name>
      </cmp-field>
      <cmp-field>
      no description
      <field-name>agregatedBOID</field-name>
      </cmp-field>
      <security-identity>

      <use-caller-identity></use-caller-identity>
      </security-identity>
      ....
      <ejb-relation>
      <ejb-relation-name>ArgregationBORelationship</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>AgrigationRole</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>BOAgrigationEnrollmentBean</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>agrregatedBOEntity</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>BORole</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>BOEntityBean</ejb-name>
      </relationship-role-source>
      </ejb-relationship-role>
      </ejb-relation>
      ....

      me jbosscmp-jdbc.jar:
      ...

      <ejb-name>BOAgrigationEnrollmentBean</ejb-name>
      <table-name>BorAgrigation</table-name>
      <cmp-field>
      <field-name>businessObjectID</field-name>
      <column-name>cboId</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>number</field-name>
      <column-name>agrNumber</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>agregatedBOIdentifier</field-name>
      <column-name>agrIdentifier</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>agregatedBOID</field-name>
      <column-name>agrigatedCboId</column-name>
      </cmp-field>

      ...

      <ejb-name>BOEntityBean</ejb-name>
      <table-name>BorCbo</table-name>
      <cmp-field>
      <field-name>identity</field-name>
      <column-name>identity</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>businessObjectID</field-name>
      <column-name>cboId</column-name>
      </cmp-field>

      ...
      <ejb-relation>
      <ejb-relation-name>ArgregationBORelationship</ejb-relation-name>
      <foreign-key-mapping/>
      <ejb-relationship-role>
      <ejb-relationship-role-name>BORole</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>businessObjectID</field-name>
      <column-name>agrigatedCboId</column-name>
      </key-field>
      </key-fields>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>AgrigationRole</ejb-relationship-role-name>
      </ejb-relationship-role>
      </ejb-relation>
      ....

      Can anybody help me?

      Thanks in advance.

      P.S. my null topic contains the xmls.

        • 1. Re: One more CMR bug?
          dsundstrom

          Specify the column name mapping for the columns names that are too long.

          • 2. Re: One more CMR bug?
            starco

            I have no such columns in table.

            • 3. Re: One more CMR bug?
              dsundstrom

              Yes you do. Otherwise you would not get the select.

              It looks like an fk column. Check you server.log file.

              • 4. Re: One more CMR bug?
                starco

                I can not force to work on JBoss 3.0 RC1 my beans still, but they work on WebLogic 6.1/7.0 fine. And I don't understand the reasons of it. I use CMR 2.0.

                The database details:
                I have two tables between which I have 2 relationhips.
                1. table BorCbo with column
                cboId - pk
                identity
                defId
                2. table BorAgrigation with column
                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>

                The beans have deployed succesful. But during work the server throws java.sql.SQLException: ORA-00972: identifier is too long. The SQL statement (from server.log):
                INSERT INTO BORCBO (cboId, identity, BOAgrigationEnrollmentBean_agrregatedBOEntity_agregatedBOID, BOAgrigationEnrollmentBean_agrregatedBOEntity_businessObjectID, defId) VALUES (?, ?, ?, ?, ?)
                Two colum names are very strange for me:
                BOAgrigationEnrollmentBean_agrregatedBOEntity_agregatedBOID and BOAgrigationEnrollmentBean_agrregatedBOEntity_businessObjectID
                The table BorCbo in db does not contains these colums. But JBoss thinks that they exist.
                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?
                I think the above information will be useful to help me.


                >It looks like an fk column. Check you server.log file.
                What should I search in server.log? I have checked this file and found only 2 encountered entries.
                1. 2002-05-03 10:03:14,215 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.BOEntityBean] Insert Entity SQL: INSERT INTO BORCBO (cboId, identity, BOAgrigationEnrollmentBean_agrregatedBOEntity_agregatedBOID, BOAgrigationEnrollmentBean_agrregatedBOEntity_businessObjectID, defId) VALUES (?, ?, ?, ?, ?)

                and

                2. 2002-05-02 17:50:18,415 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.BOEntityBean] Executing SQL: SELECT identity, BOAgrigationEnrollmentBean_agrregatedBOEntity_agregatedBOID, BOAgrigationEnrollmentBean_agrregatedBOEntity_businessObjectID, defId FROM BORCBO WHERE (cboId=?)
                2002-05-02 17:50:18,475 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:23 31)
                at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatemen t.java:422)
                at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement .java:366)
                at org.jboss.resource.adapter.jdbc.local.PreparedStatementInPool.executeQuery(Prep aredStatementInPool.java:862)

                • 5. Re: One more CMR bug?
                  starco

                  There are descriptors.

                  • 6. Re: One more CMR bug?
                    dsundstrom

                    Start by switching to the latest release.