MySQL Connection Timeout Issue - Grails Application on Tomcat using Hibernate and ORM

后端 未结 7 2171
青春惊慌失措
青春惊慌失措 2020-12-08 07:42

I have a small grails application running on Tomcat in Ubuntu on a VPS. I use MySql as my datastore and everything works fine unless I leave the application for more than ha

7条回答
  •  误落风尘
    2020-12-08 08:21

    Add these parameters to dataSource

            testOnBorrow = true
            testWhileIdle = true
            testOnReturn = true
    

    See this article for more information http://sacharya.com/grails-dbcp-stale-connections/

提交回复
热议问题