db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Weber (JIRA)" <j...@apache.org>
Subject [jira] Updated: (TORQUE-111) Thrown RuntimeExceptions cause database connections to remain open
Date Fri, 28 Mar 2008 19:08:24 GMT

     [ https://issues.apache.org/jira/browse/TORQUE-111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Neil Weber updated TORQUE-111:
------------------------------

    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.

  was: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.


Added solution.

> Thrown RuntimeExceptions cause database connections to remain open
> ------------------------------------------------------------------
>
>                 Key: TORQUE-111
>                 URL: https://issues.apache.org/jira/browse/TORQUE-111
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime
>    Affects Versions: 3.2, 3.3
>            Reporter: Neil Weber
>            Priority: Critical
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message