[ 
https://issues.apache.org/jira/browse/IMPALA-10032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17169911#comment-17169911
 ] 

jayashree commented on IMPALA-10032:
------------------------------------

Hi Tim,

I am connecting two databases using *cloudera.impala.jdbc41.Driver. (Version 
2.6.3)*

*Executing two Cucumber feature files together:*

*Feature file 1: I am connecting to first impala database (_Eg: 
connectionUrl1),_ executing sql statement, closing the connection (con.close() 
)*

*Feature file 2**: I am connecting to second impala database (_Eg: 
connectionUrl2),_ executing sql statement, closing the connection (con.close() 
)*

 

+*Issue*++:+ *Feature 1 gets completed successfully ie Database 1 connection, 
SQL execution, but the connection 1 does not gets closed. And the java code of 
feature file 2 tries to execute the SQL query in connection 1.*

 

*ie: Java code is trying to search presence of Table of connection 2 database 
in first database, and script aborts with error.*

 

*Caused by: com.cloudera.support.exceptions.GeneralException:*
*[Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error 
Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, 
errorMessage:AnalysisException: Could not resolve table reference:***

*Sample code:*
Feature 1:

try{
        Connection con = null;
        ResultSet rs = null;
        Statement stmt = null;  String connectionUrl = 
"jdbc:impala://<impala_url>:50050/f1s;AuthMech=1;KrbHostFQDN=Dummy;KrbRealm=Dummy;SSL=1
  String jdbcDriverName = "com.cloudera.impala.jdbc41.Driver";            
Class.forName(jdbcDriverName);

        con = DriverManager.getConnection(connectionUrl);
        stmt = con.createStatement();
        logger.info("Executing query");
        rs = stmt.executeQuery("Select abc from table1;");      while 
(rs.next()) \{
          rs.getString("abc");
        }
        rs.close();
        stmt.close();
        logger.info("Connection Status:"+con.isClosed());
        con.close();
        logger.info("Connection Status:"+con.isClosed());
}catch(Exception e)\{
        e.printStackTrace();
        }
}
-*********************************************************************************

Feature 2:
Feature 1:

try{ 
Connection con = null; 
ResultSet rs = null;
Statement stmt = null; 
String connectionUrl = 
"jdbc:impala://<impala_url>:8080/f1s;AuthMech=1;KrbHostFQDN=Dummy;KrbRealm=Dummy;SSL=1
  String jdbcDriverName = "com.cloudera.impala.jdbc41.Driver"; 
Class.forName(jdbcDriverName); 

con = DriverManager.getConnection(connectionUrl); 
stmt = con.createStatement(); 
logger.info("Executing query"); 
rs = stmt.executeQuery("Select bcd from table2;"); 
while (rs.next())
 \{ rs.getString("bcd"); } 
rs.close(); 
stmt.close();
 logger.info("Connection Status:"+con.isClosed()); 
con.close(); logger.info("Connection Status:"+con.isClosed());
 } catch(Exception e)\{ e.printStackTrace(); }
 

> Unable to close the connection when fetching data from two databases
> --------------------------------------------------------------------
>
>                 Key: IMPALA-10032
>                 URL: https://issues.apache.org/jira/browse/IMPALA-10032
>             Project: IMPALA
>          Issue Type: Bug
>            Reporter: jayashree
>            Priority: Blocker
>
> Hi Team,
> I am connecting two databases using cloudera.impala.jdbc41.Driver.
> I have two classes with two different connections, each having different SQLs 
> to perform in respective database.
> When I am executing these two classes together, I am getting below error 
> though I am closing first connection and then connecting to other Database.
> Error: 
> j*ava.sql.SQLException: [Simba][ImpalaJDBCDriver](500051) ERROR processing 
> query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, 
> sqlState:HY000, errorMessage:AnalysisException: Could not resolve table 
> reference:* 
> *Caused by: java.sql.SQLException:*
> *[Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error 
> Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, 
> errorMessage:AnalysisException: Could not resolve table reference:* 
> *Caused by: com.cloudera.support.exceptions.GeneralException:*
> *[Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error 
> Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, 
> errorMessage:AnalysisException: Could not resolve table reference:* 
>  
> *Seems its not able to close first connection.*
> *Can you please check it*



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to