开发者

ASP.NET Event reservation application - Seats count issue

Im about to create a very simple online event reservation application and currently have 3 tables:

User

  • PK_UserID
  • UserName

Event

  • PK_EventID
  • EventName
  • EventDescription
  • EventStartDate
  • EventEndDate
  • SeatsAvailable

BookedEvents

  • ID
  • FK_UserID
  • FK_EventID

Do you have any experience of how to handle SeatsAvailable? I mean if SeatsAvailable is set to 5 and there are 5 users online and want to book event. And some user has started to fill out the fo开发者_Go百科rm then changed his mind. Then seats in database can just leak. I was thinking about sessions - like to limit every user to 5 minutes to complete the booking but i dont really know if its good idea. Do you have any suggestions?


I dont really see your problem.

SeatsAvailable would be the total allowed seats, and the number of booked users would be the sum of the rows on BookedEvents.

in your procedure to enter a user to BookedEvents you would read the count of BookedEvents and SeatsAvailable in a transaction, if the event is full then the users gets a message saying the they are too late

am i missing something?


I would use your way as well, but I would reset the timeout everytime the booking is progressed (ie. new page). I know from experience you sometimes have to look something up or similar, and I really hate pages timing out in that case. You should be fine with a timeout.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜