Derby
  1. Derby
  2. DERBY-5104

InterruptResilienceTest fails to remove tables in tearDown()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.8.1.2
    • Fix Version/s: 10.8.1.2
    • Component/s: Test
    • Labels:
      None
    • Bug behavior facts:
      Regression Test Failure

      Description

      If the test case testInterruptBatch runs before the other test cases in InterruptResilienceTest, the subsequent test cases will fail with errors like the following one:

      6) testRAFReadWriteMultipleThreads(org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest)java.sql.SQLException: Table/View 'T1' already exists in Schema 'APP'.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:98)
      at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:256)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:396)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
      at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2290)
      at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1334)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:630)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:179)
      at org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest.setUp(InterruptResilienceTest.java:127)

      The problem appears to be that testInterruptBatch turns auto-commit off, so that BaseTestCase.tearDown() will roll back the dropping of test tables in InterruptResilienceTest.tearDown().

      1. derby-5104-1a.diff
        0.9 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        The attached patch makes tearDown() commit after dropping the test tables. This way, the call to super.tearDown() won't later roll back the cleanup if auto-commit has been turned off by the test case.

        Show
        Knut Anders Hatlen added a comment - The attached patch makes tearDown() commit after dropping the test tables. This way, the call to super.tearDown() won't later roll back the cleanup if auto-commit has been turned off by the test case.
        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 1079349.

        Show
        Knut Anders Hatlen added a comment - Committed revision 1079349.

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development