Why does my Tomcat only open 8 JDBC connections

后端 未结 2 901
再見小時候
再見小時候 2020-12-11 09:35

When setting up the database connections in Tomcat 8, for some reason Tomcat is not following what I configured in the context.xml, with as result that I run out of connecti

2条回答
  •  一向
    一向 (楼主)
    2020-12-11 10:33

    Quote from "Tomcat Expert: Configuring jdbc-pool for high-concurrency":

    When Tomcat reads the type="javax.sql.DataSource" it will automatically configure its repackaged DBCP, unless you specify a different factory. The factory object is what creates and configures the connection pool itself.

    It turns out that DBCP package just ignores a series of settings. Adding the following line to the context.xml resource configuration, gets better response in the database:

    
    

    Show processlist in mysql then immediately shows the desired behaviour.

提交回复
热议问题