-->
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.  [ 1 post ] 
Author Message
 Post subject: Optimistic lock propagation on many-to-many
PostPosted: Thu Feb 10, 2011 5:19 am 
Newbie

Joined: Sat Dec 11, 2010 8:49 am
Posts: 19
Hello,

I have class Operator with basic data and set of bosses which are operators also.
So this is many-to-many relation because each operator can have one or more bosses and
also one or more employees.
I create additional table OperatorHierarchy with BossID and EmployeeID columns.
In mapping files i define sets like this:
<set name="bosses" inverse="true" lazy="true" table="operatorhierarchy" fetch="select">
<key>
<column name="EmployeeID" not-null="true" />
</key>
<many-to-many column="BossID" class="operator" />
</set>

Everything works ok except i cannot propagate optimistic locking on these sets.
E.g. if one application user delete boss from operator and other user in meantime
add boss to same operator in database i want to StaleObjectStateException be thrown.
However i cannot accomplish these.
I set optimistic-lock="all" dynamic-update="true" on both operator and operatorhierarchy mapping files.

Can someone help me about this.


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

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.