aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Temporary reservation 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 "Temporary reservation" Watch "Temporary reservation" New topic
Author

Temporary reservation

Sergiy Kononenko
Greenhorn

Joined: Mar 20, 2009
Posts: 23
Hi,

my URLyBird application must allow the user to book accomodations.
I provide the main frame of my GUI with a detailed dialog, which allows the user to check record data, to input customer ID and finally to confirm booking.
Do I have to reserve this record in the server so that nobody else can book it during this time?

Is my GUI design reasonable at all?

Thanks.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5545
    
  13

Hi Sergiy,

Welcome to the ranch!

in my assignment i can read the following


So because a room-booking will result in an update of the appropriate record, you have to lock the record before you can actually update it. and when you are done, you have to unlock that record too of course.

so your business logic would be something like:


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Sergiy Kononenko
Greenhorn

Joined: Mar 20, 2009
Posts: 23
Hi Roel,

thank you.
This is what I do if the user confirms booking in my dialog.
But should I lock the record if the user just starts the dialog?
While the user obtains the ID of the customer (eventually contacting him over the telephone), he probably expects, that nobody books this record.
Do I need to safe the record against booking by other users during this time?

Best regards,
Sergiy
Sergiy Kononenko
Greenhorn

Joined: Mar 20, 2009
Posts: 23
For better understanding, this is my booking dialog:


[Thumbnail for BookingDialog.JPG]

Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2267
    
    3

Hey, champ. Got your point. Well, this is not really necessary. What Roel explained above is when the user presses the "Book" button.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5545
    
  13

Hi Sergiy,

Let's say you lock the record when you open the dialog. user gets an email to book room x. he searches the record, dialog opens (and record is locked) and then he goes out for lunch, so record will be locked until he gets back. No other user can book that room. So that's not a good idea to do in my opinion. you have to make sure the locking time of a record is as small as possible.

Lock the record when user hits submit-button will do.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2267
    
    3

you have to make sure the locking time of a record is as small as possible.


Agreed.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5545
    
  13

Roberto Perillo wrote:
you have to make sure the locking time of a record is as small as possible.


Agreed.


Great minds think alike
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2267
    
    3

Great minds think alike


Agreed!
Sergiy Kononenko
Greenhorn

Joined: Mar 20, 2009
Posts: 23
Roel De Nijs wrote:Hi Sergiy,

Let's say you lock the record when you open the dialog. user gets an email to book room x. he searches the record, dialog opens (and record is locked) and then he goes out for lunch, so record will be locked until he gets back. No other user can book that room. So that's not a good idea to do in my opinion. you have to make sure the locking time of a record is as small as possible.

Lock the record when user hits submit-button will do.


Well, the server could automatically release locks when the specified time expires.
But you guys already answered my question: if you did not do it so and have passed, it must be really not required.
Thanks a lot!
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5545
    
  13

Sergiy Kononenko wrote:
But you guys already answered my question: if you did not do it so and have passed, it must be really not required.


Roberto passed, i have still some weeks to go before i can submit my assignment anf hopefully i will pass too
Sergiy Kononenko
Greenhorn

Joined: Mar 20, 2009
Posts: 23
Roel De Nijs wrote:
Sergiy Kononenko wrote:
But you guys already answered my question: if you did not do it so and have passed, it must be really not required.


Roberto passed, i have still some weeks to go before i can submit my assignment anf hopefully i will pass too


Well then good luck!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Temporary reservation