Reputation: 75
What's the best practice for disabling optimistic locking in Grails globally (for all the domain classes) if i'm not using Mongo? Thanks!
Upvotes: 5
Views: 1858
Reputation: 457
By default GORM is configured with optimistic locking enabled. You can disable this by calling the version method with an argument of false:
In your domain class, set a mapping like this:
static mapping = {
// Used to disable optimistic locking
version false
}
Upvotes: 2
Reputation: 4373
If you want to disabling optimistic locking in Grails globally then you can put in Config.groovy
grails.gorm.default.mapping = {
version false
}
Upvotes: 9