Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ensuring database integrity

    If I have a web page with a function that updates a database, what ensures that multiple users don't write to the database simultaneously and corrupt it? Does mySQL take care of this, or is there some lock command I must issue? I have been searching the doc, but I don't see anything.

    G

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    I believe you asked this question before and I believe I answered it already. Yes databases incorporate a mechanism similar to locking files to ensure that simultaneous requests to read/write take turns.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, thanks. I guess when I read your earlier answer I was unclear what you were saying - it sounded like you were saying that one had to take specific actions with a database just as with a flat file to ensure integrity. Now, I understand that the database does this itself. That would be one good reason to use them. Thanks.


    G

  • #4
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    If you read up on the history of databases you will find that using organized file systems was one of the first concepts of a database. Files would be organized into directories then whatever program was written to handle searching, reading and writing had to deal with ensuring data integrity.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •