-->
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: One-to-many optimistic version control strategy
PostPosted: Tue Jun 02, 2009 1:20 am 
Newbie

Joined: Thu Jan 13, 2005 4:04 am
Posts: 12
Location: Estonia
Hi,

Some simple questions about how does hibernate (3.2.6/oracle) handling optimistic version control with one-to-many model constructions.

Consider following:

I have simple one-to-many relation (without any cascades defined) where both parent and related MOs have optimistic version control defined on (with "version" annotation). When I initialize both parent and collection of it's related objects in session (smth. like that: find("FROM Parent p JOIN FETCH p.childs")) and update only and only some child entity from related childs collection (some object from the many-side collection/childs) then hibernate automatically performs SQL update both for updated entity from parent's child collection (that was actually updated) as well for parent (to increase it's sys version field by 1).

Why does it update parent when it was unchanged and there is not any cascade defined as well? How can I prevent this or to get rid of inefficient implementation like this?

I found link to issue and as far as I concern this is defined as "normal" strategy in hibernate?
http://opensource.atlassian.com/project ... se/HB-1514

Thnks,
Sincerely
Ilhan


Top
 Profile  
 
 Post subject: Re: One-to-many optimistic version control strategy
PostPosted: Mon Aug 10, 2009 3:42 am 
Newbie

Joined: Thu Jan 13, 2005 4:04 am
Posts: 12
Location: Estonia
Hi,

Answer is that this default feature is connected with @OptimisticLock(excluded=true) configuration option.

Thkns.
I.


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.