• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

NX: about Locking instruction

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
in my instruction

You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server


Does this means I must not use lock unlock in standalone mode,
if so how about the update(recno, data[], lockCookie) method, do I need write another one for standalone mode operation? since it need lockCookie.

I don't want to lose my money from the deviation of requirement.

thanks for your reply
 
Author
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't interpret that as meaning I must not lock if in non-networked mode. But it would reduce overhead if your app recognized that you were in non-networked mode and did not lock as a consequence.

"At a minimum you must be concerned X" != "You must do only and precisely X". That is, X is a subset of things with which you might be concerned.

That's how I interpreted it, but defensively didn't lock the records in non-networked mode, since it is not necessary to do so.
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eben Hewitt:

That's how I interpreted it, but defensively didn't lock the records in non-networked mode, since it is not necessary to do so.



In my requirements I'm pretty sure there is something about standalone mode using the same code as the client and server, with the networking removed. So if you lock on the server but not in the standalone version, it may be a problem.
 
oneal shark
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eben,
As you said:

Originally posted by Eben Hewitt:

That's how I interpreted it, but defensively didn't lock the records in non-networked mode, since it is not necessary to do so.



how about update method, I noticed there is a lockCookie needed for this method, or I need to write another method?

Thanks
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic