db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fischer (JIRA)" <j...@apache.org>
Subject [jira] Reopened: (TORQUE-8) village does not close every resultSet it opens
Date Mon, 18 Feb 2008 23:46:34 GMT

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

Thomas Fischer reopened TORQUE-8:
---------------------------------

      Assignee:     (was: Scott Eade)

The issue is not fixed.

a) the problem still exists that resultSet.close() is not called on open ResultSets and Statements.
In some cases this is not a problem because the garbage collector usually closes open ResultSets
and Statements if they are garabege collected or the underlying connection closes its resultSet
if it is closed, but in some other (not rare) cases this does not work. It is difficult to
reproduce the issue because the garbage collector's policy can not be influenced in the necessary
ways, so not being able to reproduce the error does not mean it is fixed.

b) The appended patch solves the problem only in cases where the executed query succeeds.
In cases where the query does not succed a non-closed statements remains lingering about.
One clean solution would be using a try...finally block, like

Statement statement = null
RecordSet recordSet = null;
try
{
   // fill and use recordset and statement
}
finally
{
  if (recordSet != null)
  {
    try
    {
      recordSet.close();
    }
    catch (SQLException e)
    {
      // log and/or discard e
    }
  }
  if statement != null)
  {
    try
    {
      statement.close();
    }
    catch (SQLException e)
    {
      // log and/or discard e
    }
  }
}



>  village does not close every resultSet it opens
> ------------------------------------------------
>
>                 Key: TORQUE-8
>                 URL: https://issues.apache.org/jira/browse/TORQUE-8
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime, Village
>    Affects Versions: 3.0, 3.1, 3.1.1, 3.2
>            Reporter: Thomas Fischer
>         Attachments: village-2.0-TORQUE-8.patch
>
>
> In the village classes Record and Schema, ResultSets are opened which are not closed
afterwards. This can lead to a "too many open cursors" error in oracle. Thanks to Hendrik
Busch for reporting the error.

-- 
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