Uploaded image for project: 'Torque'
  1. Torque
  2. TORQUE-111

Thrown RuntimeExceptions cause database connections to remain open

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.2, 3.3
    • Fix Version/s: 4.0-beta1
    • Component/s: Runtime
    • Labels:
      None

      Description

      In the doSelect(), doDelete(), doInsert(), and doUpdate() methods in BasePeer a database connection is obtained, some work performed, and then, if successful, the work is committed and the database connection is closed. If a TorqueException is thrown while performing the work, the work is rolled back and the database connection is closed. If a RuntimeException is thrown while performing the work, the work is not rolled back and the database connection remains open.

      The fix is simple: catch Exception (or Throwable) instead of TorqueException. This will ensure that, no matter what the problem is, Torque ensures the database connection is closed.

        Attachments

          Activity

            People

            • Assignee:
              tfischer Thomas Fox
              Reporter:
              nweber Neil Weber
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0.25h
                0.25h
                Remaining:
                Remaining Estimate - 0.25h
                0.25h
                Logged:
                Time Spent - Not Specified
                Not Specified