-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Cascading updates when lock is called.
PostPosted: Wed Sep 24, 2008 5:59 pm 
Beginner
Beginner

Joined: Wed Sep 24, 2008 5:44 pm
Posts: 34
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!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 26, 2008 2:26 pm 
Beginner
Beginner

Joined: Wed Sep 24, 2008 5:44 pm
Posts: 34
No?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.