Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) error
I have a problem, I get this error:
Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
I understand what it causing the problem, or rather i think i understand.
It is caused because i have an object "A" and object "B" both have a "C" object in it. When i collect A and B in a variable, i get it with a version number, and also getting C with a version number. When i save A, then A and also C will get a new version, and saving B is not possible, because hibernate checks the C objects version and it is different than it was when i grabbed B (containing C).
Of course this could come handy, but to me it is the biggest nightmare... In the application i made C lets say it is contsant (not literally, you can alter the object, but on a different form, with different privileges).
But even if i dont change C object it will get a new version number, and there are a lot of cases where bonita fails to save my A,B etc objects because of this C object version problem. Just so you can understand I have cars and cars can have certain products, normally the products dont change at all. The relation is aggregation, because not just cars can have products.
What could solve this problem? Is there a way to turn off version check?