Strong Z.Q. Jiang

Greenhorn
+ Follow
since Dec 25, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Strong Z.Q. Jiang

if a client wants to delete a record,it maybe call such methods in following order:
long cookie = lock(recNo);
delete(recNo,cookie);
unlock(recNo,cookie);

the trouble is:
if the record was deleted successfully then the unlock methods must throws RecordNotFoundException,I think it is unreasonable,how do you think?
in my instruction:
// Modifies the fields of a record. The new value for field n
// appears in data[n]. Throws SecurityException
// if the record is locked with a cookie other than lockCookie.
public void update(int recNo, String[] data, long lockCookie)
throws RecordNotFoundException, SecurityException;

why not throws DuplicateKeyException while create method throws DuplicateKeyException ? how to deal with update method's DuplicateKeyException?
Hi,everyone:
Can I define a record like:{recNo,deleted,name,location,size,smoking,rate,date,owner}?
Some reasons:
1.I can cache all db file's records information(include recNo and deleted) into memory for performance
2.Methods using recNo(update or deleted etc.) or deleted(e.g:create a record reusing a deleted entry) will be easy implemented and have good efficiency
What I am worried about is:
The following methods:
public void update(int recNo, String[] data, long lockCookie)
public String[] read(int recNo)
public int[] find(String[] criteria);
public int create(String[] data)
which have relation with record(String array) will have to use my record definition ,is it permitable?

I really appreciate any help!