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

Thejas M Nair commented on HIVE-11915:
--------------------------------------

bq. There's no SQLException, there's simply a closed connection being returned. 
The exception happens later when Hive code tries to use it.

Thats the SQL exception I was referring to. In bonecp code, whenever the 
connection class throws an exception (in setAutoCommit for example), it calls 
markPossiblyBroken ,
ie, something like the following generic code should work - 
{code}
  protected Connection getDbConn(int isolationLevel) throws SQLException {
  while(true) {
   try {
    Connection dbConn = connPool.getConnection();
    dbConn.setAutoCommit(false);
    dbConn.setTransactionIsolation(isolationLevel);
    return dbConn;
    } catch (SQLException e){
      if(max num of retries is not exceeded ) {
       log.warn(e);
      }
      else {
       throw e;
      }
    }
  }
{code}

> BoneCP returns closed connections from the pool
> -----------------------------------------------
>
>                 Key: HIVE-11915
>                 URL: https://issues.apache.org/jira/browse/HIVE-11915
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Takahiko Saito
>            Assignee: Sergey Shelukhin
>         Attachments: HIVE-11915.WIP.patch, HIVE-11915.patch
>
>
> It's a very old bug in BoneCP and it will never be fixed... There are 
> multiple workarounds on the internet but according to responses they are all 
> unreliable. We should upgrade to HikariCP (which in turn is only supported by 
> DN 4), meanwhile try some shamanic rituals. In this JIRA we will try a 
> relatively weak drum.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to