We have a grails application crashing in tomcat 7.0.30. The Grails version was 2.2.4, and it has been very stable over the past year. I tried switching the version of Grails to 2.3.4, in the test environment it worked fine (no problem). But when I put it into production in 20 minutes, I started getting the following exceptions
[ajp-bio-9009-exec-430] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:100; busy:100; idle:0; lastwait:30000].. Stacktrace follows: org.apache.tomcat.jdbc.pool.PoolExhaustedException: [ajp-bio-9009-exec-430] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:100; busy:100; idle:0; lastwait:30000]. at grails.gorm.DetachedCriteria$_count_closure4.doCall(DetachedCriteria.groovy:686) at grails.gorm.DetachedCriteria$_withPopulatedQuery_closure10.doCall(DetachedCriteria.groovy:931) at org.grails.datastore.gorm.GormStaticApi$_withDatastoreSession_closure20.doCall(GormStaticApi.groovy:680) at org.grails.datastore.mapping.core.DatastoreUtils.execute(DatastoreUtils.java:302) at org.grails.datastore.gorm.AbstractDatastoreApi.execute(AbstractDatastoreApi.groovy:37) at org.grails.datastore.gorm.GormStaticApi.withDatastoreSession(GormStaticApi.groovy:679) at grails.gorm.DetachedCriteria.withPopulatedQuery(DetachedCriteria.groovy:913) at grails.gorm.DetachedCriteria.count(DetachedCriteria.groovy:684) at grails.gorm.DetachedCriteria.count(DetachedCriteria.groovy:683) at com.webbfontaine.wftaglib.BeanDataLoadController.doLoadData(BeanDataLoadController.groovy:30) at com.webbfontaine.wftaglib.BeanDataLoadController$_closure1.doCall(BeanDataLoadController.groovy:14) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at org.josso.tc70.agent.SSOAgentValve.invoke(SSOAgentValve.java:684) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)
In our application, all database queries are executed through Grails GORM, we do not use SQL or HQL query.
I assume that something is wrong in Grails 2.3.4 itself (some connections are not closed / returned to the pool correctly).
Am I missing something or is his problem with the grails? Any ideas?
tomcat grails gorm
Aram arabyan
source share