This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
In my opinion, you should do locking on server. cuz you will need to do locking by implementing lock(int recNo) in Data class and this should be on server side. The client doesn't need to care about the record locking. You just expose the book method to client.Then book method will probably invoke lock()->update()->unlock(). This depends on your design.
who is the customer booking this recrod , i think you must pass additional parameter customer number:
book(int rec, String eightDigitCustNumber)
also may be another clients delete this record during client view and another one create another record with different data in the same location so the record number for new record will be the same and when the viewing client want to book record he will book the new record that differ
Best regards. Mohamed Darim.
fei lin
Ranch Hand
Joined: Nov 25, 2007
Posts: 39
posted
0
Originally posted by mohamed sulibi: hi;
who is the customer booking this recrod , i think you must pass additional parameter customer number:
book(int rec, String eightDigitCustNumber)
also may be another clients delete this record during client view and another one create another record with different data in the same location so the record number for new record will be the same and when the viewing client want to book record he will book the new record that differ
Best regards. Mohamed Darim.
Thanks Mohamed, so client book the wrong record, is that acceptable?
Thanks Mohamed, so client book the wrong record, is that acceptable?
Hi,
I think what Mohamed meant, is that you should make sure that the client holds the "latest" data of the record he wants to book. For instance, the client could be working on "old" data and I believe you should prevent him from modifying such record.
So, you could consider passing the original record and compare it to the database before allowing its update/booking.
But that's at the "service/Business" level, the Data layer does not care..
bye, Alex [ March 24, 2008: Message edited by: Alex Belisle Turcot ]
mohamed sulibi
Ranch Hand
Joined: Sep 04, 2005
Posts: 169
posted
0
hi;
thank you Alex for your reply i mean exactly what you said.