Problema com pool de conexão tomcat 7 + grails 2.2.4 + mysql 5.5
20/08/2015 09:17
O nosso DataSource está da seguinte maneira
ERROR [Thread: ajp-bio-127.0.0.1-8009-exec-36] [util.JDBCExceptionReporter], msg:[ Cannot get a connection, pool error Timeout waiting for idle object ]
?Timeout waiting for idle object. Stacktrace follows: ]java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1167)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at grails.orm.HibernateCriteriaBuilder.invokeMethod(HibernateCriteriaBuilder.java:1618)
at br.edu.unirn.sisuni.subsistema.EventosController.getEventosComInscricaoHoje(EventosController.groovy:45)
at br.edu.unirn.sisuni.subsistema.EventosController.index(EventosController.groovy:30)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
dataSource {Poderiam me orientar?
pooled = true
driverClassName = "com.mysql.jdbc.Driver"
username = "USUÁRIO DO BANCO"
password="SENHA DO BANCO"
dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "update"
url =""
}
}
test {
dataSource {
dbCreate = "update"
url = ""
}
}
production {
dataSource {
dbCreate = "update"
url = "URL"
properties {
maxActive = 50
maxIdle = 25
minIdle = 5
initialSize = 5
minEvictableIdleTimeMillis = 60000
timeBetweenEvictionRunsMillis = 60000
maxWait = 10000
validationQuery = "/* ping */"
}
}
}
}
Para se registrar, clique aqui.