• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Lock all records before add?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When is lock-all-record used? Do you need to lock all-record before adding a record?
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I don't believe is required to deliver the add and delete operation. Take a better look in your assignment and let me know.
Ricardo
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My assignment says that I have to provide all the public methods of the Data class at client side. And somewhere else, that I have to implement network version of Data class functions. So, it means for me that you have to implement add() method.
Add means db lock for me, but I am interested in others opinion about this, also. Because this is a self describer db, record count (the third int in the db) can be spoiled without db lock at add method).
Br,
Ban
 
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is for some kind of emergency situation on the server side.
For a system like FBN, user will probablly only be allowed to book and search.

Originally posted by Xihang Liu:
When is lock-all-record used? Do you need to lock all-record before adding a record?


 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for adding / deleting records you don't need a db lock. it is enough if you assure that only only client is adding / deleting records at any given time since you have to check for exsting of the primary key.
Should be enough to make add / delete synchronized
Rainer
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To address the original question "When is lock all records used"? I used it when shutting down my server.
If you do a ctrl-c shutdown, clients could have outstanding locks while the server shuts down.
 
Did you miss me? Did you miss this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic