File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Bookseats flow! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Bookseats flow!" Watch "Bookseats flow!" New topic

Bookseats flow!

Vikas Sood
Ranch Hand

Joined: Sep 03, 2002
Posts: 109
Hi friends '
My bookSeats method has the flight number and no of seats to be booked as parameter.
First of all i use find of Data class to find a record for this flight number.From the record i get hold of record number for the record.
With this record number as a parameter i call lock(int recNum),then getRecord(int recNum)for retriving the record,after that a check for available seats is run from which no. of seats to be booked is subtracted,then unlock(int recNum) is called.
Is this flow appropriate.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Sounds great to me. you are basically Lock-Read-Modify-Unlock.

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Bookseats flow!
It's not a secret anymore!