Disable optimistic global locking in Grails

What is the best practice to disable optimistic locking in Grails globally (for all domain classes) if I don't use Mongo? Thank!

+4
source share
2 answers

If you want to disable optimistic locking in Grails globally, you can add Config.groovy

grails.gorm.default.mapping = {
    version false
}
+8
source

By default, GORM is configured with optimistic locking enabled. You can disable this by calling the version method with false:

In your domain class, define this mapping as follows:

static mapping = {
// Used to disable optimistic locking
version false
}

Here is the link for reference

+1
source

Source: https://habr.com/ru/post/1569220/


All Articles