On 23/02/2023 20:55, Artur Tomusiak - Hannon Hill wrote:

A few follow up questions:

    - Which of the two workarounds would be more recommended? Would there be
    any problems with mismatching tomcat-dbcp.jar version or with using the
    useLocalSessionState parameter?

It depends.

Given the nature of the tomcat-dbcp.jar, I don't foresee any compatibility issues using tomcat-dbcp.jar from any version of Tomcat 9.0.x with any other version of Tomcat 9.0.x.

There is a maintenance issue in that updating Tomcat becomes a little more complicated.

You also need to be sure that the problem described in DBCP-558 isn't going to affect your application.

useLocalSessionState looks to be the simpler solution but you should be aware of the caveats described here:
https://forums.mysql.com/read.php?39,626495,626511

A third option is to use a different database connection pool. Although that carries the risks of the unknown. You are probably better off with a minimal change to fix the issue you see.

    - Since the solution in the Pull Request seems to result in a
    considerable performance hit, would that be considered an issue or
    necessary evil? Should we expect such an issue to be fixed in the future or
    do we just need to adjust and live with it?

I think the general expectation is that application servers are normally located close to the database they use and round-trip latency should be negligible compared to the time taken for the actual DB operations.

An enhancement/PR might be accepted to make the fix in DBCP-558 optional but that would be a decision for the Commons DBCP project.

    - Out of curiosity, has anyone else here noticed such database
    connection performance degradation between these versions of Tomcat
    (essentially between 9.0.37 or earlier, and 9.0.38 or later)? Since DBCP
    2.8.0 was released in 2020-09-21 and Tomcat 9.0.38 was released
    in 2020-08-11, it's a bit strange that this issue was not reported
    previously by anyone.

I don't recall seeing any such reports - either here or with DBCP.

Mark


Thank you,
Artur Tomusiak

On Wed, Feb 22, 2023 at 12:43 PM Mark Thomas <ma...@apache.org> wrote:

On 22/02/2023 04:58, Konstantin Kolinko wrote:
ср, 22 февр. 2023 г. в 01:31, Artur Tomusiak - Hannon Hill
<artur.tomus...@hannonhill.com>:

After upgrading from Tomcat 9.0.33 to Tomcat 9.0.69,

Note that using a binary search (bisection) one could limit the version
range.

Relevant version information is:

9.0.71 - DBCP f131286  2.10.0-SNAPSHOT  2022-12-30
9.0.53 - DBCP 2abdb49  2.9.0            2021-08-03
9.0.42 - DBCP e24196a  2.9.0-SNAPSHOT   2021-01-15
9.0.38 - DBCP 6d232e5  2.8.0-SNAPSHOT   2020-08-11
9.0.30 - DBCP a363906  2.8.0-SNAPSHOT   2019-12-06


Alternatively, it is possible to reconfigure the pool to use Apache
Commons DBCP 2 and Apache Commons Pool 2 directly (instead of
package-renamed version used by Tomcat), and bisect their version
ranges.

Given Tomcat's tendency to update to specific commits rather than
releases, bisecting Tomcat versions is probably easier.

Does your database provide any form of debug logging? The additional
commands should be easy to spot in such a log.

Changes to autoCommit and readOnly handling in 9.0.38 could result in
additional database calls. See
https://issues.apache.org/jira/browse/DBCP-558

I don't see anything else obvious in the change history but a debug log
for the connection is likely to be the quickest way to see what is going
on.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to