aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S: locking without a cookie Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S: locking without a cookie" Watch "B&S: locking without a cookie" New topic
Author

B&S: locking without a cookie

Sam Sang
Greenhorn

Joined: Jun 21, 2005
Posts: 10
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


SCJP 1.4<br />SCJD <br />SCWCD (in progress)
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
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

Joined: Jun 21, 2005
Posts: 10
Thanks John,
Can you please point me to that thread if possible.
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
Here are a few: 1, 2, 3, 4.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11285
    
  59

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


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Sam Sang
Greenhorn

Joined: Jun 21, 2005
Posts: 10
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

Joined: Jun 21, 2005
Posts: 10
John,
Thanks a lot for pointing to the threads with those discussion. It really helps.

Sam
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11285
    
  59

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: B&S: locking without a cookie
 
Similar Threads
implementing interface methods within another interface method
Question about lock()
B&S no lock cookies
NX: [UrlyBird 1.3.1] - locking and [client] thread death
My Locking Method: please, advise me.