Hello all,
Hibernate Version: 3
I'm fairly new to hibernate and ran across this problem today and was wondering if this functionality is intended (and why) or if it is a bug in Hibernate.
I have a mapping of Object1 which contains a Set of Object2s. In the mapping document of Object1 I set the cascade mode of Object2 to 'save-update'. I was noticing that when I called session.lock(Object1, LockMode.NONE) on a detached, unmodified instance of Object1 hibernate executed updates on each Object2 in the Set. i.e. Object1 cascades update to Object2 without update being called on Object1.
However (after struggling for about 5 hours) when I changed the cascade mode of Object2 to 'all', no updates are fired when executing session.lock(Object1, LockMode.NONE). Which is how I would have expected it to behave in the first place.
Any thoughts, or explanation as to why this occurs would be greatly appreciated!
|