I am developing a hotel booking site. It is a J2ee web application and I am using Jsp and JDBC.
I have one method which is responsible to book the hotel rooms.
booking()
And from this method I am calling other four other methods
bookRooms()
makePayment()
confirmUserByMail()
confirmUserBySMS()
I am aware of that it can happen two users can try to book the same room at the same time and in my current system it is possible that two users might end up with the same room.
How should I handle the transaction to avoid this concurrency issue?
It might be very common scenario but I never handled this kind of scenario before, so please guide me.
Aucun commentaire:
Enregistrer un commentaire