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

B&S: locking without a cookie

 
Sam Sang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,
I am working on B&S version 2.3.1. I am reading the posts about locking and everybody talks about lock cookie. But my assignment have the method lock without a cookie
-------------------------------------------------------------------------
// Locks a record so that it can only be updated or deleted by this client.
// If the specified record is already locked, the current thread gives up
// the CPU and consumes no CPU cycles until the record is unlocked.
public void lock(int recNo) throws RecordNotFoundException;
// Releases the lock on a record.
public void unlock(int recNo) throws RecordNotFoundException;
-------------------------------------------------------------------------
After reading the previous posts I am confused as to how I can use lock cookie in my design and implementation. I am stuck here. Please help me.
Did any body get this version of Assignment?

Thanks
Sam
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sun has different versions of the assignment to make it difficult for the candidates to swap the solutions. But yes, there are discussions in this forum between the folks who do not have the cookie parameter in the lock/unlock signatures. You've got to find some equivalent of that to uniquely identify the client without modifying the lock/unlock signatures.
 
Sam Sang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks John,
Can you please point me to that thread if possible.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are a few: 1, 2, 3, 4.
 
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 Sam,

Welcome to JavaRanch and this forum.

You might also be interested in reading the JavaRanch SCJD FAQ. The issue of different method signatures is discussed there.

Regards, Andrew
 
Sam Sang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrew,
Sorry, I know what mistake I did. I read the SCJD FAQ and I will not do it again.

Thanks
Sam
 
Sam Sang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John,
Thanks a lot for pointing to the threads with those discussion. It really helps.

Sam
 
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 Sam
Sorry, I know what mistake I did. I read the SCJD FAQ and I will not do it again.


I wasn't suggesting you made any mistake - I was just suggesting that you might like to read the FAQ as well. The FAQ does not cover the items that John pointed you to, but it can provide you with useful information.

Hope to see more posts in the future.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic