Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is grails scaffolding transactional in any way?

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?)?

like image 211
Roman Avatar asked Oct 22 '22 12:10

Roman


1 Answers

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:

  1. run grails install-templates
  2. edit src/templates/scaffolding/Controller.groovy

Grails will use this template for generate-controller or whenever it dynamically generates a scaffolding controller.

like image 138
ataylor Avatar answered Nov 14 '22 23:11

ataylor