This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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
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