Other method should work when database is locked

Anurag Mishra

Ranch Hand

Posts: 133

posted 14 years ago

I want to ask one question when you enters -1 record only seatbooking method should be blocked and message should be displayed that database is locked, but searching, deleting and record adding method's should work, I mean that only booking should be blocked nothing else on the database. am i right. Anurag Mishra

Steve Granton

Ranch Hand

Posts: 200

posted 14 years ago

Hi, Since Sun specify only a 'write' lock in the specification I would think that you should be able to perform searches/lookups the database still. I don't believe the user should be able to remove records when the whole database is locked as this would constitute a 'write'. However, I would also interpret a 'write lock' on the entire database to mean that the user cannot add records either. How have other people interpreted this? Cheers, Steve

amit ahuja

Ranch Hand

Posts: 38

posted 14 years ago

Yes even i see it as only write lock. Becoz in our assignment, we are just asked to lock dataBase when -1 is passed to lock() method. And our lock() method is Write lock implementation only. I don't see anywhere else where they have asked anything more than that. will love to see other's view. amit