aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes lock & unlock again! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "lock & unlock again!" Watch "lock & unlock again!" New topic
Author

lock & unlock again!

Cathy Young
Ranch Hand

Joined: Mar 02, 2002
Posts: 126
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
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Cathy Young
Ranch Hand

Joined: Mar 02, 2002
Posts: 126

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
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: lock & unlock again!