Skip to content

Commit

Permalink
ReadOnly datasource should be left out of chained transaction manager
Browse files Browse the repository at this point in the history
Datasources with readOnly = true will also be left out of the chained transaction manager, see:

http://docs.grails.org/latest/guide/conf.html#multipleDatasources
  • Loading branch information
kevinclcn authored and graemerocher committed Mar 21, 2017
1 parent af3930b commit f17ad39
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ protected boolean isNotTransactional(String suffix) {
}
Boolean transactional = config.getProperty(DATA_SOURCES_PREFIX + suffix + "." + TRANSACTIONAL, Boolean.class, null);
if(transactional == null) {
transactional = config.getProperty(DATA_SOURCES_PREFIX + suffix + "." + READONLY, Boolean.class, null);
Boolean isReadOnly = config.getProperty(DATA_SOURCES_PREFIX + suffix + "." + READONLY, Boolean.class, null);
if (isReadOnly != null && isReadOnly == true) {
transactional = false
}
}
if(transactional != null){
return !transactional;
Expand Down

0 comments on commit f17ad39

Please sign in to comment.