You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2020/01/17 16:53:01 UTC

[Bug 64083] New: JDBC pool keeps closed connection as available

https://bz.apache.org/bugzilla/show_bug.cgi?id=64083

            Bug ID: 64083
           Summary: JDBC pool keeps closed connection as available
           Product: Tomcat Modules
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: jdbc-pool
          Assignee: dev@tomcat.apache.org
          Reporter: alex.panchenko@gmail.com
  Target Milestone: ---

In my case the PG driver has closed connecction because of kind of I/O error -
an attempt to pass too many parameters for PreparedStatement.

I've created an example:
https://github.com/panchenko/tomcat-bugs/blob/master/jdbc-return-closed-connection/src/test/java/org/example/jdbc/ReturnClosedConnectionTest.java

However that closed connection was added to the avaiable ones in the ppol
(despite an error during clearWarnings, etc).

And then some other code got that closed connection and failed.

The pool request: https://github.com/apache/tomcat/pull/235

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64083] JDBC pool keeps closed connection as available

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64083

Alex Panchenko <al...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alex.panchenko@gmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64083] JDBC pool keeps closed connection as available

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64083

--- Comment #2 from Christopher Schultz <ch...@christopherschultz.net> ---
(In reply to ToolGuy1 from comment #1)
> We have faced this issue in our shop as well with MS SQL Server on version
> 9.2.x driver for Java 11. Wondering if a configurable option could be added
> to the code to allow exceptions thrown from clearWarnings() calls to cause
> the pool to discard connections during return to the pool. Seems like if the
> underlying DB vendor supports clearWarnings commands that hit the db server
> ( suspect most do ), that this failing with an Exception should be a decent
> indicator that the underlying connection is not in good health.

SQL WARNINGs are not an indication of a broken connection. In fact, they are
specifically an indication of a GOOD connection: the database is in fact
communicating.

-1 on the suggestion in comment #1, though the original report seems
reasonable. to me.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64083] JDBC pool keeps closed connection as available

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64083

--- Comment #1 from ToolGuy1 <ge...@snapon.com> ---
We have faced this issue in our shop as well with MS SQL Server on version
9.2.x driver for Java 11. Wondering if a configurable option could be added to
the code to allow exceptions thrown from clearWarnings() calls to cause the
pool to discard connections during return to the pool. Seems like if the
underlying DB vendor supports clearWarnings commands that hit the db server (
suspect most do ), that this failing with an Exception should be a decent
indicator that the underlying connection is not in good health.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org