aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLyBird 1.3.3 DBMain Interx confusion regarding client identification Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird 1.3.3 DBMain Interx confusion regarding client identification" Watch "URLyBird 1.3.3 DBMain Interx confusion regarding client identification" New topic
Author

URLyBird 1.3.3 DBMain Interx confusion regarding client identification

Tom Silverman
Greenhorn

Joined: Nov 01, 2008
Posts: 24
Can someone please comment if it makes sense - I got lost (a bit): My assignment DBMain interface defines: 'public void lock(int recNo) throws RecordNotFoundException' - the comments say this: "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." I am not sure what 'this client' means. At first I thought it means some id the server issues each client for identification - but the method does not allocate any argument for this. Then I thought perhaps they mean identification by the thread name - now I am lost... Can any body figure this out? Please?


Tom Silverman: SCJP5, SCJD6, SCWCD5, SCBCD5, IBM-142, ScrumMaster
Justin Rundle
Ranch Hand

Joined: Mar 26, 2008
Posts: 123

I am not sure what 'this client' means
The current executing thread, or more simply the remote client connected to the server.
[ November 02, 2008: Message edited by: Justin Rundle ]
Tom Silverman
Greenhorn

Joined: Nov 01, 2008
Posts: 24
Thank you Justin for replying. I wish I knew. This is my question. 'This Client' is what the instructions say. What do you make of this? If this is the current thread - can I identify it by its name? If this is the client identifier - how am I to pass this argument, say, for the 'public void lock(int recNo) throws RecordNotFoundException' method?
Justin Rundle
Ranch Hand

Joined: Mar 26, 2008
Posts: 123

how am I to pass this argument, say, for the 'public void lock(int recNo) throws RecordNotFoundException' method?
You are not required to change the method signature. If you want to use the current executing thread to identify the locked record, of which I can recommend, maybe you could use:



hint, hint...
Anton Golovin
Ranch Hand

Joined: Jul 02, 2004
Posts: 476
You need to come up with a way to identify a client by the server.
[ November 04, 2008: Message edited by: Anton Golovin ]

Anton Golovin (anton.golovin@gmail.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
Justin Rundle
Ranch Hand

Joined: Mar 26, 2008
Posts: 123

You need to come up with a way to identify a client by the server.
Not necessarily, this requirement is dependent of the specification for the assignment as some version related to a cookie no. of sorts. Whereas a method signature as discussed is pertinent to only using the recNo variable, therefore idenitifying the client mightn't be necessary.
Anton Golovin
Ranch Hand

Joined: Jul 02, 2004
Posts: 476
Having passed SCJD, i am not about to divulge how to do it, but you will have a layer of business logic in there...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: URLyBird 1.3.3 DBMain Interx confusion regarding client identification