• 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

Booking - Functionality Clarification

 
Ranch Hand
Posts: 176
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,

Two clients are running. Both clients (correctly) see no booked records in the database. Client 1 books a record X by placing a customer id of 12345678 against the record as the records owner. Client 2's GUI is still showing no owner for record X.

1 - Can client 2 place a customer ID of 87654321 against record X ?

My guess is no. What I think should happen is that you can only place a customer ID against a record if there is no ID against the record already, regardless of whether or not your GUI shows it.

So if this is the case - my next question is:

2 - Can client 2 return record X even if it was client 1 which booked the record?

If the answer to question 2 is, only client 1 (ie the client who booked the record) may return the record, what happens if client 1 terminates. Does that mean that record is forever booked?

G

 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course double bookings are not allowed. You don't want to arrive at a hotel and discover 2 couples booked the same room, no romantic weekend for you and your partner. So when client 2 wants to book an already booked record (although it seems to be available according to the GUI) an error "Room/contractor already booked. Please book another one." should be shown.

You should also make sure that the time a record is locked is as short as possible. So instead of already locking a record when the "book dialog" is shown (where you can enter the customer id), you should start the booking process (lock/update/unlock) after the user confirmed the "book dialog".

If client 1 terminates and has booked record 1, record 1 will remain booked forever (because there is no unbooking functionality). But it's quite normal a booking is booked forever (I booked a holiday at the end of October, so I hope it's still booked at the end of this month when I'm actually on holiday )
 
Glen Iris
Ranch Hand
Posts: 176
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Roel. It's just another case of the assignment requiring unrealistic functionality I guess.

Please don't go on holiday before I finish my assignment!!!who the heck is going to save me then?

Seriously buddy, thanks again and have a nice time
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Glen Iris wrote:Please don't go on holiday before I finish my assignment!!!who the heck is going to save me then?


My good buddy Roberto And don't panic: in the hotel is free wifi
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, sometimes I'm just on the background, but I'm always here
reply
    Bookmark Topic Watch Topic
  • New Topic