Alain Dickson wrote:What if somebody want to update rate field only, in that case all others have to be null, you are allowing only owner field "null"
SCJP 1.4 100%
SCJD 99.5%
// 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 updateRecord(long recNo, String[] data, long lockCookie)
Alain Dickson wrote:Alecsandru: Yes, specs do not say that, It just came out how I did it. My update method updates any non-null field.
My Question to Pete was only the first part: What if somebody just want to update the reate filed? how do you set other fields in the string which are not updating?
SCJP 1.4 100%
SCJD 99.5%
Alecsandru Cocarla wrote: you don't have to check which records are really changed
NOW if you are already checking the incoming array for any null/invalid values, THEN why not use the update method for updating non-null values which will be more flexible with almost same amount of work.
Pete wrote: Alain, you support "{ null, modified_location, null, null, modified_rate, null}", so do you make two atomic write operations to write each field into the file or read orginal record, update and write the update record back ?
I guess as long as it is jutifiable it is fine as we both are achieving the goal
I guess as long as it is jutifiable it is fine as we both are achieving the goal
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|