You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "lixiaobao (JIRA)" <ji...@apache.org> on 2019/01/03 12:40:00 UTC
[jira] [Created] (METAMODEL-1208) Call ResultSet.close() method
when after getting result from resultSet, otherwise it will cause memory
overflow.(for example use impala jdbc)
lixiaobao created METAMODEL-1208:
------------------------------------
Summary: Call ResultSet.close() method when after getting result from resultSet, otherwise it will cause memory overflow.(for example use impala jdbc)
Key: METAMODEL-1208
URL: https://issues.apache.org/jira/browse/METAMODEL-1208
Project: Apache MetaModel
Issue Type: Bug
Affects Versions: 5.1.0, 5.0.1, 5.0.0
Reporter: lixiaobao
Fix For: 5.1.1
{code:java}
ResultSet rs = null;
try {
rs = metaData.getSchemas();
while (rs.next() && result) {
result = false;
}
} catch (SQLException e) {
throw JdbcUtils.wrapException(e, "retrieve schema and catalog metadata", JdbcActionType.METADATA);
} finally {
close(null);
}
{code}
{code:java}
try {
rs = metaData.getCatalogs();
while (rs.next()) {
String catalogName = rs.getString(1);
logger.debug("Found catalogName: {}", catalogName);
catalogs.add(catalogName);
}
} catch (SQLException e)
{ logger.error("Error retrieving catalog metadata", e); }
finally {
close(connection);
logger.debug("Retrieved {} catalogs", catalogs.size());
}
{code}
{code:java}
ResultSet rs = metaData.getTables(_catalogName, null, null, JdbcUtils.getTableTypesAsStrings(_tableTypes));
while (rs.next())
{ schemas.add(rs.getString("TABLE_SCHEM")); }
{code}
At JdbcDataContext,the code list is not call ResultSet.close() method. May cause momery overflow.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)