Github user kevinxu021 commented on a diff in the pull request:

    
https://github.com/apache/incubator-trafodion/pull/1024#discussion_r108715726
  
    --- Diff: 
core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PooledConnectionManager.java
 ---
    @@ -137,12 +137,18 @@ public Connection getConnection() throws SQLException 
{
                                }
                        } else {
                                pc = (PooledConnection) free_.get(0);
    -                           if (removeFreeConnection(pc, true)) {
    -                                   TrafT4Connection c = (TrafT4Connection) 
pc.getConnection();
    -                                   try {
    -                                           
c.ic_.enforceT4ConnectionTimeout(c);
    +                           TrafT4Connection c = (TrafT4Connection) 
pc.getConnection();
    +                           try {
    +                                   c.ic_.enforceT4ConnectionTimeout(c);
    +                                   if (removeFreeConnection(pc, true)) {
                                                validConnection = true;
    -                                   } catch (SQLException sqlEx) {
    +                                   }
    +                           } catch (Exception e) {
    +                                   //ignore errors
    +                           } finally {
    +                                   if (!validConnection) {
    +                                           if (free_.remove(0) != null)
    --- End diff --
    
    @selvaganesang Thanks for you comments. i don't quit understand. It gets 
0th entry first, then remove it in removeFreeConnection( here it still in 0th). 
If it cannot be removed, that means the connection is not in free_ which is not 
reasonable( unless memory issue or something else, rarely happens but doesn't 
matter to remove again and throw exception, then the program exit). It should 
be fine to remove 0th here. 
    In standard doc for free_.remove: true if this list contained the specified 
element. it might not be represent PRESENT.



---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to