-->
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: Cascading Lock Issue
PostPosted: Thu Jul 02, 2009 8:39 am 
Newbie

Joined: Thu Jul 02, 2009 8:33 am
Posts: 1
Hi,

I have used an association mapping in one of my hbm.xml.
I have used the cascade=”lock” but the locking mechanism doesnot cascade to associated objects.

Could you let me know if there are any pre requisites for using cascade=”lock”
Or if I need to look into other things.

An example of my mapping is as follows

In Company.hbm.xml

<set name="employees" table="EMPLOYEES" lazy="false" inverse="false" cascade="lock,all-delete-orphan">
<key column="COMPANY_ID"/>
<one-to-many class="com.dao.EmployeeBean"/>
</set>


I lock the company bean by calling:


CompanyBean companyBean = (CompanyBean)
DBService.getInstance().lockData(CompanyBean.class, primaryKey,

LockMode.UPGRADE_NOWAIT);


I would also like to mention that I have a mapping for company in employee mapping

<many-to-one name="company" class="com.dao.CompanyBean " column=" COMPANY_ID " lazy="false"/>


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.