Anton Golovin (anton.golovin@gmail.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
--------<br />Andy Zhu<br />scjp 1.4<br />scjd 1.4<br />SAS Certified Programmer 9.0
T. Anthony Chen<br />---------------<br />SCJP, SCJD, SCBCD, SCWCD, SCEA
Originally posted by T. Anthony Chen:
But for the B&S assignment, there is no requirement to allow the user to delete/create/update(except booking) any records. The only things the user can do are search and book. Unless you allow the user to do the other operations, I am not sure if the problem even needs to be addressed.
Originally posted by Michal Charemza:
Hey all, I'm doing the B&S assignment.
I was wondering what a good solution was to the problem of when booking a record, making sure that it had not been deleted and a new one placed in its stead, or that is had been changed.
I read in a thread somewhere (sorry... I just can't be arsed to sift through and find it, I have read so many threads this past few weeks) that some people were considering not reusing previously deleted records. This would avoid the problem I describe above. I really don't like the idea of this, as it can lead to a very big database file, with very little information in it. Also, it may contravene my spec.
If I was to reuse the record, then would it be acceptable to send a copy of the record (i.e. a Contractor instance) to my book() method? The book method would then lock the record number, check if it aggrees with the Contractor sent, update the record with my client id, and unlock the record? That is:
lock -> check -> update -> unlock
Is there another way around this problem?
Michal
[ August 30, 2004: Message edited by: Michal Charemza ]
T. Anthony Chen<br />---------------<br />SCJP, SCJD, SCBCD, SCWCD, SCEA