You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/01/07 17:07:00 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16736053#comment-16736053 ]
ASF GitHub Bot commented on METAMODEL-1208:
-------------------------------------------
Github user asfgit closed the pull request at:
https://github.com/apache/metamodel/pull/205
> 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-0001.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)