File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Lock on the same record and diff record ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Lock on the same record and diff record ?" Watch "Lock on the same record and diff record ?" New topic
Author

Lock on the same record and diff record ?

roy shao
Greenhorn

Joined: Oct 12, 2000
Posts: 13
hi,
if client A modified record No.1, and client B also modified record No.1, the B should be blocked,
and if Client B is modifying not record No.1, such as record No.2, then client B need not be blocked ?
is my understanding correct ? please clear my idea about it.
Thank you !
Roy
ruilin yang
Ranch Hand

Joined: Feb 25, 2001
Posts: 334
Yes, You are right. This is so called "horirontal lock" scheme, which is more effecient.
roy shao
Greenhorn

Joined: Oct 12, 2000
Posts: 13
thanks, then i will wonder this: if record No.1 lock and No2 lock is not mutex, at the file I/O level, when write to file, need thread safe ? i.e. write to No1, No.2 record at same time will bring any problem ?
 
 
subject: Lock on the same record and diff record ?
 
Two Laptop Bag

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture