Advertisement
Guest User

DataSource.groovy

a guest
May 1st, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.93 KB | None | 0 0
  1. dataSource {
  2.     pooled = true
  3.     jmxExport = true
  4.     driverClassName = "oracle.jdbc.OracleDriver"
  5.     dialect = "org.hibernate.dialect.Oracle10gDialect"
  6.     username = "GRAILS"
  7.     password = "grails"
  8.     url = "jdbc:oracle:thin:@localhost:1521:xe"
  9. }
  10. hibernate {
  11.     cache.use_second_level_cache = true
  12.     cache.use_query_cache = false
  13.     hibernate.jdbc.use_get_generated_keys = true
  14. //    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
  15.     cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
  16.     singleSession = true // configure OSIV singleSession mode
  17.     flush.mode = 'manual' // OSIV session flush mode outside of transactional context
  18. }
  19.  
  20. // environment specific settings
  21. environments {
  22.     development {
  23.         dataSource {
  24.             dbCreate = "create" // one of 'create', 'create-drop', 'update', 'validate', ''
  25.         }
  26.     }
  27.     test {
  28.         dataSource {
  29.             dbCreate = "update"
  30.         }
  31.     }
  32.     production {
  33.         dataSource {
  34.             dbCreate = "update"
  35.             properties {
  36.                // See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation
  37.                jmxEnabled = true
  38.                initialSize = 5
  39.                maxActive = 50
  40.                minIdle = 5
  41.                maxIdle = 25
  42.                maxWait = 10000
  43.                maxAge = 10 * 60000
  44.                timeBetweenEvictionRunsMillis = 5000
  45.                minEvictableIdleTimeMillis = 60000
  46.                validationQuery = "SELECT 1"
  47.                validationQueryTimeout = 3
  48.                validationInterval = 15000
  49.                testOnBorrow = true
  50.                testWhileIdle = true
  51.                testOnReturn = false
  52.                jdbcInterceptors = "ConnectionState"
  53.                defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
  54.             }
  55.         }
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement