You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "Kasper Sørensen (JIRA)" <ji...@apache.org> on 2019/03/09 15:48:00 UTC

[jira] [Resolved] (METAMODEL-1208) Call ResultSet.close() method when after getting result from resultSet, otherwise it will cause memory overflow.(for example use impala jdbc)

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

Kasper Sørensen resolved METAMODEL-1208.
----------------------------------------
    Resolution: Fixed

> 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.0.0, 5.0.1, 5.1.0
>            Reporter: lixiaobao
>            Priority: Major
>             Fix For: 5.2.1
>
>         Attachments: METAMODEL-1208.patch
>
>
> {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.I just offer a patch.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)