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

前端 未结 2 973
孤城傲影
孤城傲影 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
    

提交回复
热议问题