Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to comprehend such a method in URLyBired?

 
Zhixiong Pan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,
I am still unclear about such a method in my URLyBird assignment.The method is in Data.java which implements interface DB.

// 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{

}

Can anyone give me some illumination?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Zhixiong,

Perhaps some more information on where you are having difficulties would help get answers?

A client will call the update method when it wants to modify a record. The update method will check that the recNo has been locked, and that the lock is owned by lockCookie. If so, then it overwrites the recNo record in the database with the data provided.

Does this help? If not, can you provide more information on what is unclear?

Regards, Andrew
 
Zhixiong Pan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrew,
Your answer is very clear, and I understand indeed now.Meanwhile I have a problem about multi-client designing which i have posted a new post. If you have time to read it, it would be very kind of you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic