Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-5734

End transaction if CleanDatabaseTestSetup.decorateSQL fails

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.9.1.0
    • 10.9.1.0
    • Test
    • None

    Description

      By overriding CleanDatabaseTestSetup.decorateSQL you are allowed to perform tasks as part of the test setup / decorator. The connection obtainable through the passed in statement is configured with auto-commit off. If decorateSQL fails the connection may be left active in the middle of a transaction, which again may cause subsequent tests to fails. I've observed subsequent tests fail due to locks helds by the statement / connection passed to decorateSQL.

      CleanDatabaseTestSetup.setUp should ensure the transaction is ended regardless of whether decorateSQL throws an exception or not.

      Attachments

        1. derby-5734-1a-end_transaction.diff
          1 kB
          Kristian Waagan
        2. derby-5734-1b-end_transaction.diff
          1 kB
          Kristian Waagan

        Activity

          People

            kristwaa Kristian Waagan
            kristwaa Kristian Waagan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: