wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Locking more than one records.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Locking more than one records.." Watch "Locking more than one records.." New topic
Author

Locking more than one records..

Pallav Grigo
Greenhorn

Joined: Mar 29, 2002
Posts: 29
Hi..I've read some posts on how the Connection object for each client implements the Unreferenced interface...so that it unlocks "all" the locksthat it currently holds...Here's my problem...in my design..the client can only book one flight at a time..although he/she can enter the number of seats..so they get only one lock at a time..so can i just keep the current lock in an int variable and then unlock that in case the client crashes?
Regards,
Pallav
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Pallav, if you can guarantee that it will ever forever only have one lock at any time, then you should be fine.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
I think the key issue here is that "Your user interface should be designed with the expectation of future functionality enhancements".
This may mean that a future enhancement could be select a route and book all available seats. This would mean that more than one row would be locked until the seat booking request had been executed.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Locking more than one records..
 
Similar Threads
Deadlock during record locking
My Locking Approach
client locking row twice
B&S: Lock file with Channel
Sync Question