Gossamer Forum
Home : Products : DBMan : Customization :

What is the downfall to not using file locking

Quote Reply
What is the downfall to not using file locking
Recently I have had trouble with a subroutine that was having some file access problems on NT.

If I turned file locking to off, the problem went away.

What is the downside to having file locking off ?
Quote Reply
Re: What is the downfall to not using file locking In reply to
If two people try to add/delete/modify at the same time, there is a possibility that the database will get corrupted. If you are only using it for searching, then it's not a big deal, or if only you as an admin are doing updates, then again it's not a big deal.

However, if it's open to the public to update, you might have some database corruption problems. Make sure to backup often!

Cheers,

Alex

[This message has been edited by Alex (edited February 24, 1999).]
Quote Reply
Re: What is the downfall to not using file locking In reply to
No clue what flock (DB, 8) means, but it worked fine on my Unix server, but did not on NT.

When I changed it to flock (DB, 2) it worked fine on both Unix and NT.
Quote Reply
Re: What is the downfall to not using file locking In reply to
Ack, did you find flock(DB, 8) in version 2.04 code? That was an old bug I was sure I fixed (The 8 means unlock and the 2 means lock -- you get an error as you are trying to unlock something that is already locked. Also you shouldn't need to unlock as perl's close() function does it better).

Let me know!

Cheers,

Alex
Quote Reply
Re: What is the downfall to not using file locking In reply to
It's my fault, Alex. I helped him with a subroutine and must have opened the wrong file. Not to worry -- 2.04 doesn't have it. Smile

------------------
JPD
Quote Reply
Re: What is the downfall to not using file locking In reply to
Does this mean that for a db that is read-only (except for regular updates by administrator only) that it would be better to have file locking off (i.e. if multiple people are reading the database at the same time, would they have to "wait their turn" with file locking on, but be able to have simultaneous access with file locking off?)

Bruce

------------------
--
Bruce Dienes
bdienes@iname.com