Permalink
Browse files

Update DataSource to use local postgres

  • Loading branch information...
influenza committed May 18, 2014
1 parent c85d300 commit 60282f17c8e60aaa4abefada14d5e809912a156f
Showing with 41 additions and 39 deletions.
  1. +1 −1 grails-app/conf/BuildConfig.groovy
  2. +40 −38 grails-app/conf/DataSource.groovy
@@ -49,7 +49,7 @@ grails.project.dependency.resolution = {
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
// runtime 'mysql:mysql-connector-java:5.1.27'
// runtime 'org.postgresql:postgresql:9.3-1100-jdbc41'
runtime 'org.postgresql:postgresql:9.3-1100-jdbc41'
}
plugins {
@@ -1,9 +1,3 @@
dataSource {
pooled = true
driverClassName = 'org.h2.Driver'
username = 'sa'
password = ''
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
@@ -13,37 +7,45 @@ hibernate {
}
environments {
development {
dataSource {
dbCreate = 'create-drop' // one of 'create', 'create-drop', 'update', 'validate', ''
url = 'jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000'
development {
dataSource {
dbCreate='update'
url="jdbc:postgresql://localhost:5432/petclinic"
username = "grails"
password = "super secure"
pooled = true
logSql = false // <-- set to true to see SQL queries being sent to DB
driverClassName = "org.postgresql.Driver"
dialect = net.sf.hibernate.dialect.PostgreSQLDialect
properties {
maxActive = -1
minEvictableIdleTimeMillis = 1800000
timeBetweenEvictionRunsMillis = 1800000
numTestsPerEvictionRun = 3
testOnBorrow = true
testWhileIdle = true
testOnReturn = true
validationQuery = "SELECT 1"
}
}
}
test {
dataSource {
dbCreate = "update"
url = 'jdbc:postgresql://localhost:5432/petclinic'
}
}
production {
dataSource {
pooled = true
driverClassName = "org.postgresql.Driver"
dialect = net.sf.hibernate.dialect.PostgreSQLDialect
// Uncomment the following line to see what SQL queries are
// being sent to the database.
// logSql = true
}
}
test {
dataSource {
dbCreate = 'update'
url = 'jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000'
}
}
production {
dataSource {
dbCreate = 'update'
url = 'jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000'
pooled = true
properties {
maxActive = -1
minEvictableIdleTimeMillis=1800000
timeBetweenEvictionRunsMillis=1800000
numTestsPerEvictionRun=3
testOnBorrow=true
testWhileIdle=true
testOnReturn=true
validationQuery='SELECT 1'
}
}
}
dbCreate = "update"
jndiName = "java:comp/env/petclinicDatasource"
}
}
}

0 comments on commit 60282f1

Please sign in to comment.