I looked at Controller.groovy source code, and it looks like CRUD operations are not transactional (at least explicitly).
If I'm right, does it mean that dynamic scaffolding should not be used in production as is? Is there a way to make it transactional (i.e. can I modify Controller.groovy or whatever?)?
You are correct, the scaffolding is not transactional. This might be because grails and hibernate support data sources that don't support transactions, such as MySQL's MyISAM engine.
You can change it to be transactional as follows:
grails install-templates
src/templates/scaffolding/Controller.groovy
Grails will use this template for generate-controller or whenever it dynamically generates a scaffolding controller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With