Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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

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.
 
Your mother was a hamster and your father was a 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