So I just got this working as expected. All you need to do is include the Hikari dependency, and set pooled: true in your application.yml.
Additional properties can be set on the Hikari connection pool by specifying them in the properties section on the dataSource
Do not create a dataSource bean in resources.groovy, as this will cause all sorts of problems if pooled is set to true, and is largely ignored if pooled is false (apart from consuming and leaving idle the entire pool of connections)
build.gradle extract:
...
compile 'com.zaxxer:HikariCP:2.7.7'
...
application.yml extract:
...
dataSource:
pooled: true
driverClassName: "org.postgresql.Driver"
postgresql:
extensions:
sequence_per_table: false
logSql: false
dbCreate: ""
username: "username"
password: "password"
url: "jdbc:postgresql://..."
properties:
maximumPoolSize: 30
registerMbeans: true
connectionTimeout: 30000
...
Its not clear to me exactly how grails/gorm detects the connection pool provider, and I'm not sure what would happen if you had two connection providers configured. I just made sure that the default tomcat dependency was missing from my build.gradle
# Remove this line from build.gradle if you have it
runtime 'org.apache.tomcat:tomcat-jdbc'