Skip to content

Commit 2252523

Browse files
committed
GRAILS-11177 GRAILS-10063 Add configuration options for configuring read-only attribute passing to Hibernate in default Config.groovy - adds also OSIV singleSession mode config option to default DataSource.groovy
1 parent efb263e commit 2252523

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

grails-resources/src/grails/grails-app/conf/Config.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ grails.exceptionresolver.params.exclude = ['password']
8383
// configure auto-caching of queries by default (if false you can cache individual queries with 'cache: true')
8484
grails.hibernate.cache.queries = false
8585

86+
// configure passing transaction's read-only attribute to Hibernate session, queries and criterias
87+
// set "singleSession = false" OSIV mode in hibernate configuration after enabling
88+
grails.hibernate.pass.readonly = false
89+
// configure passing read-only to OSIV session by default, requires "singleSession = false" OSIV mode
90+
grails.hibernate.osiv.readonly = false
91+
8692
environments {
8793
development {
8894
grails.logging.jul.usebridge = true

grails-resources/src/grails/grails-app/conf/DataSource.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ hibernate {
1010
cache.use_query_cache = false
1111
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
1212
// cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
13+
singleSession = true // configure OSIV singleSession mode
1314
}
1415

1516
// environment specific settings

0 commit comments

Comments
 (0)