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 Locking/ Synchronization Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Locking/ Synchronization" Watch "Locking/ Synchronization" New topic
Author

Locking/ Synchronization

Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
Hi,
I�m using vector to hold all the locked records.
I�m wondering whether I should synchronize the lock and unlock methods. My concern is user B has to wait until user A completes lock method though user B is locking different record.
I really appreciate any suggestions.
Thanks
Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
I would steer away from having user B wait until user A is finished with a different record.
Tom Peillon
Greenhorn

Joined: Mar 30, 2001
Posts: 9
Why are you holding the locked records in a vector, isn't
a better approach to synchronize on the row objects themselves?
Won't you have a problem that if a user locks a record and then gets disconnected due to a network problem, the row won't get
removed from the vector?
 
 
subject: Locking/ Synchronization
 
Threads others viewed
Frustated, Your view on this
Optimistic vs. Pessimistic Locking
No need for a locking manager?
Locking info: a DB field vs. in-memory
Question with Habibi's Locking Example
MyEclipse, The Clear Choice