I know that, at some point between Grails 1.X and Grails 2.X, the default connection pooling library changed from commons-dbcp
to tomcat-dbcp
.
Now, I'm trying to configure either BoneCP or HikariCP as the connection pooling library for my Grails application.
However, I see that this answer offers a solution which might only apply to Grails 1.X.
I also found this Gist, but again, I don't know which Grails version it applies to.
So, is it possible to define a custom connection pool inside a Grails 2.3.6 application? Thanks!
UPDATE: OK so you actually need to tell Grails not to pool the datasources, since HikariCP is now taking care of this.
I saw connection weirdness in my apps if I left that switch on. So instead say:
OK yeah, @Joshua Moore is right.
I tried doing it with updated Grails methods and this is the relevant section of my
resources.groovy
file. As far as I can understand, the configuration values inDatasource.groovy
are pulled intoresources.groovy
at runtime, after the target runtime environment has been identified (development
,test
orproduction
).And this is the relevant section of my
DataSource.groovy
configuration:In my case, it's pretty much the same for
test
andproduction
environments. Thanks!