Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

a simple question of Locking mechanism

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

I have a simple question , It is necesary to use the lock class when I search a record in mode networked ?

Thanks
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No,there is no need to lock for the read operation.
 
dennis du
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a general rule from database field.
 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok ,thanks for your help.

Irene.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not needed.

But, I chose to lock the entire database when I do any operation.
This seems like a dumb thing at first, but it saves u a lot of scenario testing for your locking scheme.
Furthermore, good table based locking (not the one we are implementing) is FASTER than record based locking.
This is because of the lack of overhead on row level locks.
So even though it is not needed to lock when reading, I would (and do).
Document your decisions well !
Good luck
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Frank Verbruggen:
It is not needed.

But, I chose to lock the entire database when I do any operation.
This seems like a dumb thing at first, but it saves u a lot of scenario testing for your locking scheme.
Furthermore, good table based locking (not the one we are implementing) is FASTER than record based locking.
This is because of the lack of overhead on row level locks.
So even though it is not needed to lock when reading, I would (and do).
Document your decisions well !
Good luck



Will it not affect the number of concurreny users access? Since the data item granularity is so large like that to the table, I am quite sure that some other users might not be able to access that table during the time someone is accessing it...
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! 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
    Bookmark Topic Watch Topic
  • New Topic