1 Reply Latest reply on Dec 4, 2002 1:08 AM by 3004

    Index error

    3004
      Hi:

      I deleted every table in the database (including the schema tables) and
      tried to regenerate the database.... I am experimenting with options to
      try to get the table format I want......any way when I tried to regenerate I
      got an error from schematool about creating an index... the error is
      in the SQL itself (this SQL fails in oracle)... In looking what kodo is
      trying to do it seems that it is creating an index using a name that is
      already defined??? I am a little confused here... Here is the error:

      The key point is the SQL:
      CREATE INDEX LOANCOLLECTION_CREDITAGREEMENX ON
      LOANCOLLECTION_CREDITAGREEMENX (JDOIDX)
      This is not valid SQL... it did not occur the first time I created the DB,
      but this was a gradual process adding a few tables at a time.
      This time I was trying to create all the tables at the same time... I am not
      sure why this should be different, but this is what I have
      seen.... As I have said I know the problem (invalid SQL being generated),
      but I do not know why it is happening. Any insight would
      be appreciated.

      C:\bcs\jdo\kodo-jdo-2.3.4\aqueduct>schematool -action refresh aqueduct.jdo
      [ C:126452; T:2961925; D:12/2/02 11:34 AM ] connect: jdbc:oracle:thin:
      @ds101.dev .global.chase.com:1521:aquadev9 (scott): 1 Refreshing schema for
      type "class aqueduct.DealTeamMember" and all known subclas ses Refreshing
      schema for type "class aqueduct.Currency" and all known subclasses
      Refreshing schema for type "class aqueduct.User" and all known subclasses
      Refreshing schema for type "class aqueduct.Tranche" and all known subclasses
      CREATE INDEX LOANCOLLECTION_CREDITAGREEMENX ON
      LOANCOLLECTION_CREDITAGREEMENX (JDOIDX) Exception in thread "main"
      java.sql.SQLException: ORA-00955: name is already used by an existing object
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)

      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:1405)

      at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)

      at
      oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1602
      )

      at
      oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1527)

      at
      oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
      :2045)

      at
      oracle.jdbc.driver.OracleStatement.doScrollStmtExecuteQuery(OracleStatement.
      java:5462)

      at
      oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:756)

      at
      com.solarmetric.kodo.impl.jdbc.datasource.StatementImpl.executeUpdate(Statem
      entImpl.java:78)

      at
      com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.executeSQL(SchemaTool.java:
      1044)

      at
      com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.createTable(SchemaTool.java
      :853)

      at
      com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refreshTable(SchemaTool.jav
      a:503)

      at
      com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refreshTables(SchemaTool.ja
      va:514)

      at
      com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refresh(SchemaTool.java:310
      )

      at
      com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refresh(SchemaTool.java:272
      )

      at
      com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1317)

      at
      com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1190)



        • 1. Re: Index error
          3004
          Brian,

          There are two common causes for this problem. First, you may be using
          field names that result in index names that are too long. So, when we
          truncate the names, we may be causing the index name that we're
          generating to be the same as an existing index.

          Second, if the index error happens while creating a join table for a
          shared many-many relation, we could actually be trying to create the
          same index multiple times.

          We've done a good deal of work to resolve this problem and some other
          schematool issues, but the schematool does not yet use that codebase.

          Note that you can set the '-ignoreErrors' flag to true to temporarily
          get around the problem.

          -Patrick

          Brian Smith wrote:
          Hi:

          I deleted every table in the database (including the schema tables) and
          tried to regenerate the database.... I am experimenting with options to
          try to get the table format I want......any way when I tried to
          regenerate I
          got an error from schematool about creating an index... the error is
          in the SQL itself (this SQL fails in oracle)... In looking what kodo is
          trying to do it seems that it is creating an index using a name that is
          already defined??? I am a little confused here... Here is the error:

          The key point is the SQL:
          CREATE INDEX LOANCOLLECTION_CREDITAGREEMENX ON
          LOANCOLLECTION_CREDITAGREEMENX (JDOIDX)
          This is not valid SQL... it did not occur the first time I created the DB,
          but this was a gradual process adding a few tables at a time.
          This time I was trying to create all the tables at the same time... I
          am not
          sure why this should be different, but this is what I have
          seen.... As I have said I know the problem (invalid SQL being generated),
          but I do not know why it is happening. Any insight would
          be appreciated.

          C:\bcs\jdo\kodo-jdo-2.3.4\aqueduct>schematool -action refresh aqueduct.jdo
          [ C:126452; T:2961925; D:12/2/02 11:34 AM ] connect: jdbc:oracle:thin:
          @ds101.dev .global.chase.com:1521:aquadev9 (scott): 1 Refreshing
          schema for
          type "class aqueduct.DealTeamMember" and all known subclas ses Refreshing
          schema for type "class aqueduct.Currency" and all known subclasses
          Refreshing schema for type "class aqueduct.User" and all known subclasses
          Refreshing schema for type "class aqueduct.Tranche" and all known
          subclasses
          CREATE INDEX LOANCOLLECTION_CREDITAGREEMENX ON
          LOANCOLLECTION_CREDITAGREEMENX (JDOIDX) Exception in thread "main"
          java.sql.SQLException: ORA-00955: name is already used by an existing
          object
          at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)

          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:1405)

          at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)

          at
          oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1602
          )

          at
          oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1527)

          at
          oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
          :2045)

          at
          oracle.jdbc.driver.OracleStatement.doScrollStmtExecuteQuery(OracleStatement.
          java:5462)

          at
          oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:756)

          at
          com.solarmetric.kodo.impl.jdbc.datasource.StatementImpl.executeUpdate(Statem
          entImpl.java:78)

          at
          com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.executeSQL(SchemaTool.java:
          1044)

          at
          com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.createTable(SchemaTool.java
          :853)

          at
          com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refreshTable(SchemaTool.jav
          a:503)

          at
          com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refreshTables(SchemaTool.ja
          va:514)

          at
          com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refresh(SchemaTool.java:310
          )

          at
          com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refresh(SchemaTool.java:272
          )

          at
          com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1317)

          at
          com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1190)


          --
          Patrick Linskey pcl@solarmetric.com
          SolarMetric Inc. http://www.solarmetric.com