• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URLyBird 1.3.3 DBMain Interx confusion regarding client identification

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 123
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 531
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 531
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic