I have a method on grails 2.4.3 (I removed the parts that does not matter):
@Override
protected void handleAnswerEvent(Message event) {
def con = Contrato.find("from Contrato where ? in elements(telefones)", [tel])
}
But this method is running in a thread outside of the grails managed classes (I'm not very sure that what I'm saying here makes sense...). The point is is after a while it gives me:
org.apache.tomcat.jdbc.pool.PoolExhaustedException: [http-bio-8080-exec-254] Timeout: Pool empty.
Changing the max connections does not solve the problem of the leak. What am I supposed to do to grails to close this automatically or is there other way to solve this?
take a look of these links, I guess they may help you to solve your problem
https://jira.grails.org/browse/GRAILS-11043
https://jira.grails.org/browse/GRAILS-11700
Thanks.
[Update]
Issue is something related to connection pool leak problems. Using GroovySQL outside of transaction context leaks connections if you don't explicitly close the the connection (GRAILS-5454 fixed that in transactional context, but the problem remains outside of transactions). take a look of these links, I guess they may help you to solve your problem. Issue have been resolved in grails 2.4.4
https://github.com/grails/grails-core/issues/2797
https://github.com/grails/grails-core/issues/3017
https://github.com/grails/grails-core/issues/2776
Thanks.