wood burning stoves*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Locking and Modify Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Locking and Modify" Watch "Locking and Modify" New topic
Author

Locking and Modify

Steve Harper
Greenhorn

Joined: May 09, 2002
Posts: 3
I'm a little confused about the modifying of records using the sequence Lock, Read, Modify, Unlock on the client.
My question is do you have to modify the Modify() method so that it checks that the record is locked before updating it?
This may seem like a simple question but I can find no discussion on it anywhere in the forum.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
You may, but it's not a requirement -- it's one of those areas where you have to make your own design decision.
Personally I implemented locking not in Data, but in a Connection wrapper around Data. This Connection acquired, where necessary, record locks for a Modify or Delete operation. I did this because it seemed a good idea that was easy to do, not because I thought it was necessary to successfully complete the assignment.
- Peter
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
In my design, clients cannot modify a record unless it is locked by that client.
 
wood burning stoves
 
subject: Locking and Modify