Home Grails 2.3.6 not throwing optimistic exceptions
Reply: 0

Grails 2.3.6 not throwing optimistic exceptions

user873
1#
user873 Published in May 23, 2018, 7:20 am

I have a scaffolded domain class and I am trying to get it to throw an optimistic locking exception, but it won't. I put the same instance in edit mode in two different browsers. I edit a field in browser 1 and click update. I verified that the version increments. I then edit in browser 2 and click update. It just overwrites the browser 1 changes with the browser 2 changes. I've seen many questions here about people getting the exception when they don't want it, so I am wondering if they turned it off in Hibernate somehow. I even tried changing the update method so all it does is execute instance.save(). Am I not understanding what optimistic locking is supposed to do?

package demo
class issue {
    String synopsis
    String details

    static constraints = {
        synopsis()
        details(size: 0..1000)
    }
}
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.664676 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO