Tomcat JDBC Conencton Pool + MySQL gives “Broken pipe” problems, even with connection validation

前端 未结 2 956
孤城傲影
孤城傲影 2021-01-03 03:19

I\'m fighting with configuring Tomcat JDBC Connection Pool to achieve reliability. Current issue is that in test environment I have such scanerio in webapp:

  • da
相关标签:
2条回答
  • 2021-01-03 03:55

    We had some similar problems with one of our applications and after a lot of digging we added the following properties that solved all our connection problems:

    maxAge="180000" 
    testOnBorrow="true" 
    testWhileIdle="true"
    validationInterval="0" //forces the connection pool to validate each time a connection is given to the application
    
    0 讨论(0)
  • 2021-01-03 04:10

    You need to set 'testOnBorrow' to 'true', and probably 'maxAge' to less than the server's configured 'wait_timeout', as hinted in the message.

    0 讨论(0)
提交回复
热议问题