Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on lock()/unlock()

 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
I am a little confused about lock/unlock methods. Because the assignment already provide modify() and delete() methods, and they are synchronized. Acoording to Sun assignment, when user want to book flight, the only requirement is the seat number get deducted.
So what if for booking flight purpose, I just overload the modify() method, supply the same record but deducted seat number. Since these methods are already thread safe for the same Data object. So what is the need for lock()/unlock()?
Could anyone provide a scenario on how lock/unlock work?
Thanks in advance!
Don
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic