-->
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: Lock database record from select
PostPosted: Wed Mar 25, 2009 3:24 pm 
Newbie

Joined: Wed Mar 25, 2009 3:08 pm
Posts: 1
my question is whether hibernate can provide some feature something like locking mechanism in which if we select one record from the database it will block the record by further accessing it and unless that guy modifies it and save that record or release it will remail blocked.

scenario would be something like system access a record showing it to the user. the user is playing with the data in the presentation layer. Unless he clicks save button and hibernate session saves it other users/sessions will not be able to select the records even.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 25, 2009 6:09 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
There is a chapter about pessimistic locking in the documentation. Hibernate doesn't implement this on it's own but falls back to whatever the underlying database supports. Read more here:

http://www.hibernate.org/hib_docs/v3/re ... cking.html


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.