-->
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.  [ 3 posts ] 
Author Message
 Post subject: NHibernate Locking Question
PostPosted: Mon Aug 23, 2010 10:55 pm 
Newbie

Joined: Mon Aug 23, 2010 10:46 pm
Posts: 3
Hi, I am very new to NHibernate. I just had a quick question.

Scenario: I have 2 or more WCF Services that processes 100 records at a time (validation checks). When the 1st WCF Service grabs the first 100 records, I don't want the 2nd WCF Service to be able to read those records 100 records. How would I do this in NHibernate? I know it has something to do with the LockMode, but unsure which one.


Top
 Profile  
 
 Post subject: Re: NHibernate Locking Question
PostPosted: Wed Aug 25, 2010 11:05 am 
Newbie

Joined: Wed Aug 25, 2010 10:37 am
Posts: 2
Lockmode.Upgrade will lock the record - any transaction that attempts to access (read/write) that record will wait until the lock is released or it will timeout after a set period

var record = session.Load<Person>(PersonId, LockMode.Upgrade)


Top
 Profile  
 
 Post subject: Re: NHibernate Locking Question
PostPosted: Fri Aug 27, 2010 11:38 am 
Newbie

Joined: Mon Aug 23, 2010 10:46 pm
Posts: 3
Thanks for the information.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.