Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 9.0pe
    • Fix Version/s: not determined
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      3,554
    • Status Whiteboard:
      Hide

      HIGH

      Show
      HIGH

      Description

      During automatic DDL creation, if a generated foreign key constraint name is too
      long, an exception occurs preventing schema creation. The
      TableDefinition#buildForeignKeyConstraintName includes several levels of
      conditionals to check whether the foreignKeyName is too long, but it is still
      possible to be too long before calling to the Helper#truncate method.

      The second parameter to Helper#truncate as created below can result in a
      negative number, causing a StringIndexOutOfBoundsException to occur at the end
      of the method (see stack trace below).

      Helper.truncate(shortenedTableName, maximumNameLength -
      shortenedFieldName.length()) + shortenedFieldName

      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(String.java:1768)
      at oracle.toplink.essentials.internal.helper.Helper.truncate(Helper.java:1891)
      at
      oracle.toplink.essentials.tools.schemaframework.TableDefinition.buildForeignKeyConstraintName(TableDefinition.java:460)
      at
      oracle.toplink.essentials.tools.schemaframework.TableDefinition.buildForeignKeyConstraint(TableDefinition.java:429)
      at
      oracle.toplink.essentials.tools.schemaframework.DefaultTableGenerator.addForeignKeyConstraint(DefaultTableGenerator.java:735)
      at
      oracle.toplink.essentials.tools.schemaframework.DefaultTableGenerator.buildRelationTableFields(DefaultTableGenerator.java:362)
      at
      oracle.toplink.essentials.tools.schemaframework.DefaultTableGenerator.buildRelationTableDefinition(DefaultTableGenerator.java:328)
      at
      oracle.toplink.essentials.tools.schemaframework.DefaultTableGenerator.postInitTableSchema(DefaultTableGenerator.java:301)
      at
      oracle.toplink.essentials.tools.schemaframework.DefaultTableGenerator.generateDefaultTableCreator(DefaultTableGenerator.java:162)
      at
      oracle.toplink.essentials.tools.schemaframework.SchemaManager.getDefaultTableCreator(SchemaManager.java:802)
      at
      oracle.toplink.essentials.tools.schemaframework.SchemaManager.replaceDefaultTables(SchemaManager.java:853)
      at
      oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createOrReplaceDefaultTables(EntityManagerFactoryProvider.java:426)
      at
      oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.runInSEMode(EntityManagerFactoryProvider.java:349)
      at
      oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.generateDDLFiles(EntityManagerFactoryProvider.java:329)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:230)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:120)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91)
      at
      com.cerner.system.instrument.guernica.persistence.service.GuernicaErrorRecordServiceTest.setUp(GuernicaErrorRecordServiceTest.java:34)
      at junit.framework.TestCase.runBare(TestCase.java:128)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:120)
      at junit.framework.TestSuite.runTest(TestSuite.java:230)
      at junit.framework.TestSuite.run(TestSuite.java:225)
      at
      org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

      This occurs with toplink-essentials-1.0-58c (implementation-version
      2.0-b58c-fcs, 08/22/2007).

        Activity

        Hide
        gfbugbridge added a comment -

        <BT6599016>

        Show
        gfbugbridge added a comment - <BT6599016>
        Hide
        pkrogh added a comment -

        Downgrading because will not be fixed for this release. Would like to get this
        for the next release

        Show
        pkrogh added a comment - Downgrading because will not be fixed for this release. Would like to get this for the next release
        Hide
        Tom Mueller added a comment -

        Bulk change to set fix version to "not determined" where the issue is open but the value is for a released version.

        Show
        Tom Mueller added a comment - Bulk change to set fix version to "not determined" where the issue is open but the value is for a released version.

          People

          • Assignee:
            tware
            Reporter:
            shelleyb
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: