db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hao Zhong (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DERBY-6950) ClientConnection may be buggy
Date Thu, 13 Jul 2017 07:36:00 GMT
Hao Zhong created DERBY-6950:
--------------------------------

             Summary: ClientConnection may be buggy
                 Key: DERBY-6950
                 URL: https://issues.apache.org/jira/browse/DERBY-6950
             Project: Derby
          Issue Type: Bug
            Reporter: Hao Zhong


DERBY-210 fixed some leaked statements in Connection.java. I notice that ClientConnection.
java is similar to the buggy version of Connection.java. For example, both files have the
following methods:

{code}
  synchronized PreparedStatement prepareDynamicCatalogQuery(String sql) throws SqlException
{
        PreparedStatement ps = newPreparedStatement_(sql, java.sql.ResultSet.TYPE_FORWARD_ONLY,
java.sql.ResultSet.CONCUR_READ_ONLY, resultSetHoldability_, java.sql.Statement.NO_GENERATED_KEYS,
null);
        ps.isCatalogQuery_ = true;
        ps.prepare();
        openStatements_.put(ps,null);
        return ps;
    }
{code}

The fixed version of Connection.java is as follow:
{code}
synchronized PreparedStatement prepareDynamicCatalogQuery(String sql) throws SqlException
{
        PreparedStatement ps = newPreparedStatement_(sql, java.sql.ResultSet.TYPE_FORWARD_ONLY,
java.sql.ResultSet.CONCUR_READ_ONLY, resultSetHoldability_, java.sql.Statement.NO_GENERATED_KEYS,
null);
        ps.isCatalogQuery_ = true;
        ps.prepare();
        openStatements_.add(ps);
        return ps;
    }
{code}

It is worthy exploring whehter ClientConnection. java has similar problems. If it is, it can
be fixed as how DERBY-210 was fixed. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message