By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,244 Members | 1,972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,244 IT Pros & Developers. It's quick & easy.

Ticket Booking System

P: n/a
I am prototyping a ticket booking system and just wanted to ask a few
questions.

1 - What is the standard way of temporarily reserving a number of
tickets throughout the purchasing process (to stop other people
reserving those seats or whatever).

2 - What do you do to release these 'seats' if someone closes their
browser? Is it just a cron job set for every 20 mins?

I am sure I have seen a solution to this before but can't find it now.

Regards,

Rick

Feb 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
thehuby wrote:
I am prototyping a ticket booking system and just wanted to ask a few
questions.

1 - What is the standard way of temporarily reserving a number of
tickets throughout the purchasing process (to stop other people
reserving those seats or whatever).

2 - What do you do to release these 'seats' if someone closes their
browser? Is it just a cron job set for every 20 mins?

I am sure I have seen a solution to this before but can't find it now.

Regards,

Rick


Hopefully you are using a database to store the information...
add a columns called
rsvd_date and purchased_date,
rsvd_by, purcased_by in your "SEATS" table when someone "reserves" them update
those seats with the time they were reserved and the username that reserved
them. That way you can go back to their "reservation" should they get
disconnected before they purchase them.

Then run a job - say - every 3 hours and if there is a reserved date and no
purchased date and the reservation is > 2 hrs old (or however long you want them
to be able reserve the seats) then update the seat and set the reserved
date/username to NULL.

You MUST store this stuff in the db as your browser and/or server-side PHP
scripts run as autonomous transactions.

What that also means is that if 2 people try to reserve the same seat at the
same time, you must make sure you trap for that occurrance. (only update the
record if the reserve_date AND purchase_date is null... rows update something > 0)
--
Michael Austin.
DBA Consultant -
Oracle Rdb/Oracle RDBMS/MySQL and most any other ANSI-standard SQL-based db
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Feb 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.