Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

NX: about Locking instruction

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
 
Normally trees don't drive trucks. Does this tiny ad have a license?
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic