-->
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.  [ 4 posts ] 
Author Message
 Post subject: how to lock tables using hibernate
PostPosted: Wed Sep 08, 2004 6:21 am 
Newbie

Joined: Wed Sep 08, 2004 5:25 am
Posts: 2
can anyone pls tell me how to lock tables in the database using hibernate? my scenario is as follow:
Command1 will load objects from the database and update them.
Command2 is executed while Command1 has not yet finished executing, n Command2 updates the same objects used in Command1.

the problem is i want to block Command2 from executing if Command1 hasn't finished yet. i don't want to lock the loaded rows only but to lock the whole table.

any help will be extremely appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 08, 2004 7:22 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
read chapter 5.1 of Hibernate in Action

HTH
Ernst


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 08, 2004 10:33 pm 
Newbie

Joined: Wed Sep 08, 2004 5:25 am
Posts: 2
sorry...but i don have that book...so i kinda need some help here...could anyone juz paste some simple methods here?...thanks a lot...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 09, 2004 8:01 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
http://www.hibernate.org/hib_docs/api/n ... kMode.html

session.lock, study lockMode

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.