The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
I am not sure if it is appropriate for this forum either, but as long as the questions are expressed in terms of the assignment, then there is no problem. Besides, I am not sure where to move this to otherwise (JDBC forum, or Distributed Java forum, or OO, Patterns, UML and Refactoring, or ???)Originally posted by Reza Rahman:
I wonder if this is an appropriate question for this forum.
First you need to decide whether you really need this. In real life, airline carriers and hotel reservations systems do not notifiy clients about changes to records. The systems usually work on multi step process, typically "check availability" followed by "book seats" where the second step could fail if the availabily dropped below requested seats between first and second steps. (For those who work in these industries, yes I know there are "long sells" etc., but lets keep it simple ).Originally posted by GD Deepz:
1. Thread A does a search and gets a bunch of results. If Thread B makes a change to a particular flight or record, HOW do I inform Thread A that the record is modified and it needs to refresh to get the latest data. Will Oberverable/Observer work OR can the server inform all clients that data have changed. How do I implement this?
Why do you need to lock the client?Originally posted by GD Deepz:
2. I think in a real life app, even read process should be locked. My locking mechanism must now be very elaborate instead of just locking record no. I need to lock the actual client which is doing database operations. Can I sent an instance of the client to the server and lock it. I think RMI server can give me the client ID.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Consider Paul's rocket mass heater. |