This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate - Locking a record

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have reservation site, in that i have some set of numbers loaded in table. During reservation am fetching records one by one and updating the status as reserved.

While selecting the record am using a lock(for update) and then updating the status as reserved. In real time because of the load 2 diff threads picking the same record and second one is while update. since I have selected the record with lock.

Could someone please suggest is there any way I can restrict the record from the select which is already selected with lock..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic