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

Help Record Lock?

 
Patrick Wang
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have some question about client lock?
From complete Java 2 certification book, it talked about 3 different method of record locking?
1) Active Client-- locking record when row highlighted
2) On demand Client-- lock is integral to all add/delete/modify operations.
My question is when you use on demand client locking, how can you
prevent dirty/update, say one client update record N, released the lock, then the second client update the same record N, overwrite the update that the previous client made. I know you can have a timestamp field lastupdatetime for each record so
the second client update will fail. But it seems a little complex, just curious is there any better clean design out there
resolve this issue?
Thx
Pat
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well spotted. The solution is a lot simpler, fortunately; after locking the record, re-read it so you have fresh data. Then, if the necessary seats are still available, modify the record and write it back.
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic