Java Developer
SCJP, SCJD, SCWCD, SCBCD
Originally posted by Fl�vio Fran�a (bold parts added by me):
Option 1:
getCustomerID()
lock()
read()
update()
unlock()
Option 2:
lock()
read()
getCustomerID()
update()
unlock()
My question is: Which is the correct?
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Java Developer
SCJP, SCJD, SCWCD, SCBCD
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Java Developer
SCJP, SCJD, SCWCD, SCBCD
Your server must be capable of handling multiple concurrent requests, and as part of this capability, must provide locking functionality as specified in the interface provided above....
Java Developer
SCJP, SCJD, SCWCD, SCBCD
Originally posted by Fl�vio Fran�a:
I'm thinking in changing this solution by using a non-synchronized method to book, just to use the lock/unlock methods, but in a real situation I wouldn't do that.
Regards, George
SCJP, SCJD, SCWCD, SCBCD
But, I've got to the conclusion that these methods are not usefull at all, because if I have a synchronized method to book, I don't need to lock any record.
Java Developer
SCJP, SCJD, SCWCD, SCBCD
I'd better change it. Is it right?