Advertisement
OeleGeirnaert

DataSource.groovy

Feb 22nd, 2012
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.30 KB | None | 0 0
  1. import com.mongodb.Mongo;
  2.  
  3. dataSource {
  4.     pooled = true
  5.     driverClassName = "org.h2.Driver"
  6. }
  7. hibernate {
  8.     cache.use_second_level_cache = true
  9.     cache.use_query_cache = true
  10.     cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
  11. }
  12. // environment specific settings
  13. environments {
  14.     development {
  15.         dataSource {
  16.             dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
  17.             url = "jdbc:h2:mem:devDb;MVCC=TRUE"
  18.         }
  19.     }
  20.     test {
  21.         dataSource {
  22.             dbCreate = "update"
  23.             url = "jdbc:h2:mem:testDb;MVCC=TRUE"
  24.         }
  25.     }
  26.     production {
  27.         dataSource {
  28.             dbCreate = "update"
  29.             //          url = "jdbc:h2:prodDb;MVCC=TRUE"
  30.             //          pooled = true
  31.             //          properties {
  32.             //              maxActive = -1
  33.             //              minEvictableIdleTimeMillis=1800000
  34.             //              timeBetweenEvictionRunsMillis=1800000
  35.             //              numTestsPerEvictionRun=3
  36.             //              testOnBorrow=true
  37.             //              testWhileIdle=true
  38.             //              testOnReturn=true
  39.             //              validationQuery="SELECT 1"
  40.         }
  41.         grails{
  42.             mongo{
  43.                 username="AdminOele" //Put your own credentials here
  44.                 password="OeleGeirnaert" //Put your own credentials here
  45.                 host="192.168.1.1" //IP Address of the MongoDB Server
  46.                 databaseName = "ProdutionDB" //The name of the database, in MongoDB known as Collections
  47.                 port = 27017
  48.             }
  49.         }
  50.  
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement