I've been getting spurious OptimisticLockException / StaleObjectStateException and finally, after much digging, I found that hibernate actually bumps the version number of the parent object if one of its collections is modified.
For almost all of my collections this is not desirable, and I'd be happy to turn this feature off completely if possible.
I notice that if I use an hbm.xml file I can set an attribute optimistic-lock="true|false" (this setting was one of two clues I found indicating that changes to collections bumps the version on the parent entity). However, I haven't found its equivalent in annotations.
Is there one?
What if I just delete the collection completely and use queries to fetch the child objects when I need them?
Thanks ...
Dobes
|