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.
I understand this has been talked loooooooooooots of times already, but I still want to ask a couple of more regarding this. First, do we really need to keep track of "who" locked the record when unlocking it? The spec. says
If an attempt is made to unlock a record that has not been locked by this connection, then no action is to be done.
Is "this connection" here the same as owner? How to identify the connection, then? Second question: are we supposed to define the "record no" as in the input parameter of the methods? How? Should we virtually change the fields of the record? Thanks a lot! Cathy
Originally posted by Cathy Young: First, do we really need to keep track of "who" locked the record when unlocking it? The spec. says Is "this connection" here the same as owner? How to identify the connection, then? Second question: are we supposed to define the "record no" as in the input parameter of the methods? How? Should we virtually change the fields of the record? Thanks a lot! Cathy
There is always debate on these topics. First My opinion is that you must make sure that the client that calls unlock for a record has that lock to begin with. And yes this "Connection" object handles it. Search on Connection Object here and you will learn a lot. Especially look for Peter's comments on it. 2. What is the signature of lock and unlock? Isn't (int recordNumber)? 2b. I changed the data when a person booked a seat. Mark
2. What is the signature of lock and unlock? Isn't (int recordNumber)?
Hi Mark, Thanks! Yes, it is the signature. But My problem is that recordNumber does not seem to be a field of the record. So are we supposed to "create" this field? Thanks! Cathy
Npe, don't need to create that field. I believe there is a method in one of the db package classes that will give you the record number. I need to leave a little research on your side. Mark