import com.mchange.v2.c3p0.ComboPooledDataSourceand something like this to your configuration (Config.groovy or wherever you keep your profile configurations):
import org.codehaus.groovy.grails.commons.ConfigurationHolder
def config = ConfigurationHolder.config
if(config.dataSource.url =~ 'postgresql') {
dataSource(ComboPooledDataSource) {
driverClass = 'org.postgresql.Driver'
user = config.dataSource.username
password = config.dataSource.password
jdbcUrl = config.dataSource.url
maxStatements = 180
minPoolSize = 10
acquireIncrement = 5
maxPoolSize = 100
}
}
dataSource {Fire it up with the right profile and you should see the 10 initial connections to your postgres database by running ps -U postgres u at the console.
username = 'postgres'
password = ''
url = 'jdbc:postgresql://127.0.0.1:5432/databasename'
}
Can haz cuneckshun puling!
No comments:
Post a Comment