Hi, What about lock and unlock methods using the record number? It looks like to me, if I use recordNumber for locking, I would have to generate a primary key like id for each record and use that. It does not make sense to expose a file pointer to the business logic layer. Is this what we are expected to do? Thanks, Aruna.
Aruna - You do not need to create a primary key at all. The lock and Unlock take a record number, but it doesn't have to go search for the record in the db.db file, so it doesn't use a file pointer at all in those methods. Do a search on LockManager here and you will find an even better way to handle locks without having to implement lock/unlock in the Data class. Mark
Originally posted by mao lao: in method find(String toMatch) in Data.java says key field is the record number field, but look like flight number field Thanks
I think the key field is record number, when you lock/unlock, you have to supply record number. Regarding flight number, it is peopel that want to make it unique, for the sake of convenience.
posted 17 years ago
I am sorry, I would still have to ask where is the recordnumber coming from then? It does have to uniquely identify each record and it is presumably maintained in the server. Should the server generate ids for the records somehow even though they are not stored in the db file? Thanks.
Oops, this is what happens when you get the assignment, read it once and don't touch for a few months. Thanks Mark, I already feel like I am making progress since I came to this site few days ago. Thanks again.