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)