Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird 1.3.3 DBMain Interx confusion regarding client identification

 
Tom Silverman
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Justin Rundle
Ranch Hand
Posts: 123
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 123
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to come up with a way to identify a client by the server.
[ November 04, 2008: Message edited by: Anton Golovin ]
 
Justin Rundle
Ranch Hand
Posts: 123
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Having passed SCJD, i am not about to divulge how to do it, but you will have a layer of business logic in there...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic