Originally posted by Tom Elix:
I am reading "The Sun Certified Java Developer Exam with J2SE 1.4". It gives examples for a lock and unlock mechanism (reserveDVD, releaseDVD) which don't fulfill this part of my exam instructions: "if an attempt is made to unlock a record that has not been locked by this connection, then no action is to be taken."
What am I missing here? (I am using RMI.)
Thanks,
Tom
Hi Tom,
I may be able to help, since I wrote the book you're talking about. You're correct, the solution offered in the book is not an exact match for the solutions in the
SCJD: we wanted to provide principles, not actual, literal answers. To be honest, we were afraid that we were too close as it was
. That being said, I think you'll find that modifying that part of
test will be trivial. Try using a map instead of a vector, and track your clients, either by assignning them a ticket number or keeping track of thier thread, and you'll be where you want to be.
All best,
M, author
The Sun Certified Java Developer Exam with J2SE 1.4