• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do I have to call lock method from within the delete method?

 
Ailsa Cape
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, everyone!

I read my instructions again and find another uncertain question.

In my design, the lock method was called in the client side, so from within the update method in the Data class the lock method wasn't called. I know if I had provided the function of deleting a record, I would have added the lock method in the deleting process in the client side again. But the instructions state that Locks a record so that it can only be updated or deleted by this client. in the Data class's lock method.

So do I have to provide the lock method from within the delete mothed in the Data class? If so, the lock method will be called in both client and server sides, right?

Thanks in advance!
Regards, Ailsa Cape
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ailsa,

I am afraid I don't really understand your question. You have already determined where locking goes for the update method, so why do you think it is different for the delete method?

The way I read the instructions, the class that is about to call either update or delete must first call the lock method. I don't believe the lock method would be called by any other method within the Data class.

Regards, Andrew
 
Ailsa Cape
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Andrew

Thank you!

I am sorry for the confusion I made. In my design, I didn't make the lock method called by any other method within the Data class.

What I want to say is since I didn't provide the delete function in the client side, if the examiner wants to test it, could he/she first call the lock method in the client side? In other words, do I have to document that when a user wants to delete a record, the user must do the following sequence, "lock-read(check if the record is deleted)-delete-unlock" in the design choice file?

Thanks in advance!
Best Regards, Ailsa Cape
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ailsa,

Check the provided documentation for the lock() method - does that answer your question?

Do you need more documentation that what will appear in your API (Javadoc) documentation?

Regards, Andrew
 
Ailsa Cape
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Andrew

Thank you again!

My instructions state that the lock method is to lock a record so that it can only be updated or deleted by this client. I am sorry that I can't find the answer here.

I want to document that case in the design choice text file and not write it in lock method of the javadoc documentation. Is it proper to do so?

Thanks in advance!
Best Regards, Ailsa Cape
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic