• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Bookseats flow!

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
VikasSood
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds great to me. you are basically Lock-Read-Modify-Unlock.
Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic