[1244037] StackTrace Sanitizing stacktrace: org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [Ad] with identifier [4986]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [Ad#4986] ....
and it breaks my application. The console kept spitting same things out and the site did not work at all until I restarted it...
I am using Grails.
I think that this might have to do with a concurrent edit and the setting:
cache usage:'nonstrict-read-write', include:'non-lazy';
in my domains.
I am considering changing this to read-write only, but I am some questions on what they mean...
As I understand there is 4 different types of settings.
1. transactional
2. read-write
3. nonstrict-read-write
4. read-only
a) If I change my setting to read-write, will this still happen, if say the problem was due to a concurrent edit or update?
b) And also, how does this setting affect the use of cache and speed compared to nonstrict-read-write?
c) What is the transactional for?
d) Should I be using include:'non-lazy' ? I have the same settings in my association aswell... is it redundant?
If you know any of these answers, please try to be clear :)
Sincerely / Moe
ps. Why does the application break? I understand that hibernate might be throwing this exception up to the caller, and thats how it should be done perhaps. How can this be caught and perhaps be dismissed instead of breaking the application? Any chance anyone knows how to do this in Grails?
|