This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S deleteRecord Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S deleteRecord " Watch "B&S deleteRecord " New topic
Author

B&S deleteRecord

Harish Yerneni
Ranch Hand

Joined: Sep 15, 2004
Posts: 94
Hi all:

Here is the spec I got



I have checked for RNFE if the record is not existing in FileManager hashmap or already marked as deleted. I have thrown security exception, when cookie is not matching with the existing cookie in the hashmap or if recno doesnt exist in the lockManager hashmap itself(question: am I OK here).

I have seen in many posts they are recommending
lockRecord() - can somebody explain me why we should use lockRecord() here. I am thinking we are deleting an already locked record. If we use lockRecord(), dont we get a new cookie value here.
deleteRecord() - fine
unlock() - fine

Here is what I have coded in my Data.class


thanks,

Harish

question: Why should we lock() first, if the record is already


SCJP 1.4 | SCWCD 1.4 | SCJD (WIP)
mohamed sulibi
Ranch Hand

Joined: Sep 04, 2005
Posts: 169
hi;

i don't understand your question , but i think the sequence for calling client is:


regards.
M_darim.
SCJP, SCJD in progress ...
 
Don't get me started about those stupid light bulbs.
 
subject: B&S deleteRecord
 
Similar Threads
B&S: Why lock and update/delete throw RecordNotFoundException?
Beta Question: unlock
Interface to Data
B&S 2.1.1: lock(), delete() and unlock() confusion
No definition of what is a DuplicateKeyException