tajo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoonson <...@git.apache.org>
Subject [GitHub] tajo pull request: TAJO-1877: Adopt try-resource statement to Abst...
Date Fri, 23 Oct 2015 04:28:52 GMT
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/835#discussion_r42832337
  
    --- Diff: tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
---
    @@ -2813,22 +2647,19 @@ public static String getDatabaseNameOfTable(Connection conn, int
tid) throws SQL
       public IndexDescProto getIndexByName(String databaseName, final String indexName)
           throws UndefinedDatabaseException, UndefinedIndexException {
     
    -    Connection conn = null;
         ResultSet res = null;
    -    PreparedStatement pstmt = null;
         IndexDescProto proto = null;
     
    -    try {
    -      int databaseId = getDatabaseId(databaseName);
    +    String sql = GET_INDEXES_SQL + " WHERE " + COL_DATABASES_PK + "=? AND INDEX_NAME=?";
     
    -      String sql = GET_INDEXES_SQL + " WHERE " + COL_DATABASES_PK + "=? AND INDEX_NAME=?";
    +    if (LOG.isDebugEnabled()) {
    +      LOG.debug(sql);
    +    }
     
    -      if (LOG.isDebugEnabled()) {
    -        LOG.debug(sql);
    -      }
    +    try (Connection conn = getConnection();
    --- End diff --
    
    Why do you close the connection here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message