Details
Description
The readonly does not seem to work for me, the objects are flushed to db.
Having this service:
AlbumService.groovy
class AlbumService {
// No changes if false
boolean transactional = true
@Transactional(readOnly = true)
def Object updateObject(album = null) {
if(album){
album.name = album.name + "Frakked"
album
} else {
Album.list().each{
it.name = "" + it.name + "Frakked"
it
}
}
}
}
I attached a project with two services: AlbumTransactionalService and AlbumNonTransactionalService. None of them work as expected
Two integration test included, also the list action of AlbumController invoque both services.
-
Hide
- test-readonly-method.zip
- 11/May/10 4:16 PM
- 191 kB
- David
-
- test-readonly-method/.classpath 0.7 kB
- test-readonly-method/.project 0.5 kB
- test-readonly-method/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- test-readonly-method/application.properties 0.2 kB
- test-readonly-method/.../BootStrap.groovy 0.5 kB
- test-readonly-method/.../BuildConfig.groovy 1 kB
- test-readonly-method/.../Config.groovy 3 kB
- test-readonly-method/.../DataSource.groovy 0.6 kB
- test-readonly-method/.../resources.groovy 0.0 kB
- test-readonly-method/.../UrlMappings.groovy 0.2 kB
- test-readonly-method/.../AlbumController.groovy 4 kB
- test-readonly-method/.../SongController.groovy 4 kB
- test-readonly-method/.../Album.groovy 0.1 kB
- test-readonly-method/.../Song.groovy 0.2 kB
- test-readonly-method/.../messages.properties 3 kB
- test-readonly-method/.../messages_da.properties 3 kB
- test-readonly-method/.../messages_de.properties 4 kB
- test-readonly-method/.../messages_es.properties 3 kB
- test-readonly-method/.../messages_fr.properties 2 kB
- test-readonly-method/.../messages_it.properties 2 kB
- test-readonly-method/.../messages_ja.properties 2 kB
- test-readonly-method/.../messages_nl.properties 3 kB
- test-readonly-method/.../messages_pt_BR.properties 3 kB
- test-readonly-method/.../messages_pt_PT.properties 3 kB
- test-readonly-method/.../messages_ru.properties 4 kB
- test-readonly-method/.../messages_th.properties 5 kB
- test-readonly-method/.../messages_zh_CN.properties 2 kB
- test-readonly-method/.../AlbumNonTransactionalService.groovy 0.6 kB
- test-readonly-method/.../AlbumTransactionalService.groovy 0.6 kB
- test-readonly-method/.../create.gsp 2 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Hide
Burt Beckwith
added a comment -
Show
Burt Beckwith
added a comment - 1.3.2: http://github.com/grails/grails-core/commit/6e329451078ea787c30ce65c415f12ab957287f2
1.2.3: http://github.com/grails/grails-core/commit/aa0e8a8fcd7bbe1f64d68a57cd579d2c8b44f5aa
It also affects 1.3.0