Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1024#discussion_r108501423
--- 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 --
removeFreeConnection returns false when the pooledConnection was not
present in the free_. If so, it is not clear why are removing the 0 entry, If
line 142 returns an exception, you might want to remove the pooled connection
from free_. But, still you can't remove the 0th entry. It looks like this
code needs to be reworked
---
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.
---