File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Lock all records before add? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Lock all records before add?" Watch "Lock all records before add?" New topic
Author

Lock all records before add?

Xihang Liu
Greenhorn

Joined: Aug 28, 2001
Posts: 3
When is lock-all-record used? Do you need to lock all-record before adding a record?
Ricardo Polero
Ranch Hand

Joined: May 18, 2001
Posts: 128
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
Andras Nemeth
Ranch Hand

Joined: Jul 31, 2001
Posts: 80
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
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
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?

R Bischof
Ranch Hand

Joined: Feb 13, 2001
Posts: 48
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


Rainer<br />SCJP, SCJD, SCWCD
mitchner green
Greenhorn

Joined: Sep 18, 2001
Posts: 21
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Lock all records before add?