Skip to content
Browse files

update datasource to be 2.0.4 friendly

  • Loading branch information...
1 parent 2cd84f0 commit 2badd423e97ceaae5aa4c8dc13e84355cfb8f01c @jeffbrown jeffbrown committed Nov 28, 2012
Showing with 37 additions and 26 deletions.
  1. +37 −26 grails-app/conf/DataSource.groovy
View
63 grails-app/conf/DataSource.groovy
@@ -1,32 +1,43 @@
dataSource {
- pooled = true
- driverClassName = "org.hsqldb.jdbcDriver"
- username = "sa"
- password = ""
+ pooled = true
+ driverClassName = "org.h2.Driver"
+ username = "sa"
+ password = ""
}
hibernate {
- cache.use_second_level_cache=true
- cache.use_query_cache=true
- cache.provider_class='net.sf.ehcache.hibernate.EhCacheProvider'
+ cache.use_second_level_cache = true
+ cache.use_query_cache = false
+ cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings
environments {
- development {
- dataSource {
- dbCreate = "create-drop" // one of 'create', 'create-drop','update'
- url = "jdbc:hsqldb:mem:devDB"
- }
- }
- test {
- dataSource {
- dbCreate = "update"
- url = "jdbc:hsqldb:mem:testDb"
- }
- }
- production {
- dataSource {
- dbCreate = "update"
- url = "jdbc:hsqldb:file:prodDb;shutdown=true"
- }
- }
-}
+ development {
+ dataSource {
+ dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
+ url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
+ }
+ }
+ 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"
+ }
+ }
+ }
+}

0 comments on commit 2badd42

Please sign in to comment.
Something went wrong with that request. Please try again.