• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

a simple question of Locking mechanism

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok ,thanks for your help.

Irene.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic