SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Sean Keane wrote:Yep, that was my thinking. So Oracle just added the RNFE just to confuse us
?
I presume we can assume from this that Oracle don't have some automated test that is expecting a RNFE to be thrown in a certain scenario?
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Sean Keane wrote:If you ignored RecordNotFoundException on the unlock method I think it's safe for us all to assume this is OK to do
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Sean Keane wrote:Yes Sun confused me, and as I walked around dazed and confused Oracle stole my wallet
![]()
Thanks for the clarification Roel. If you ignored RecordNotFoundException on the unlock method I think it's safe for us all to assume this is OK to do![]()
Ixus See wrote:Just wanna confirm this... did you ignore RecordNotFoundException for unlock and pass the exam? I'm planning to ignore it too.. unless I implement if RecordNotFoundException (remove from lockrecords and notify all)
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Sarah Archer wrote:I implemented the RNFE on unlock() as it is part of the DB interface I was given and this interface "MUST" be implemented.
Sarah Archer wrote:It also made sense to me to implement this exception.
Sarah Archer wrote:That people have not implemented the RNFE and still passed may indicate that it is not an instant fail, but it is by no means certain that points won't be deducted.
To my mind not implementing the RNFE is a very brave decision.
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Sarah Archer wrote:I implemented the RNFE on unlock() as it is part of the DB interface I was given and this interface "MUST" be implemented.
Sarah Archer wrote:It also made sense to me to implement this exception.
Sarah Archer wrote:If the record you are trying to unlock() does not exist throw RNFE. If the cookie is wrong then throw SecurityException. If your code is correct then this exception should never be thrown
Sarah Archer wrote:That people have not implemented the RNFE and still passed may indicate that it is not an instant fail, but it is by no means certain that points won't be deducted.
Sarah Archer wrote:To my mind not implementing the RNFE is a very brave decision.
Roel De Nijs wrote: I passed with a perfect score
Sarah Archer wrote:@Roel I accept that it is possible to write a client that can still function correctly even without unlock() throwing, but I would not consider this good practice. For example imagine a client with a bug calls unlock() for record number 1000 and cookie 0 and record 1000 does not exist and has never existed. What should the behaviour of unlock be
Sarah Archer wrote:"Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file."
To me it is pretty clear that a RNFE exception should be thrown by unlock.
Sarah Archer wrote:Congratulations!
Sarah Archer wrote:Would love to see your choices.txt though, but alas that can never be...
"To do good, you actually have to do something." -- Yvon Chouinard
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|