This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Locking more than one records.." Watch "Locking more than one records.." New topic

Locking more than one records..

Pallav Grigo

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

Joined: Feb 05, 2001
Posts: 17276

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

Perfect World Programming, LLC - iOS Apps
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:
subject: Locking more than one records..
It's not a secret anymore!