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 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2002
    Location
    Adelaide, Australia
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lock read and write to database

    How do I lock read and write to a mysql database?

  • #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
    MySQL handles all of that for you.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New Coder
    Join Date
    Jul 2002
    Location
    Adelaide, Australia
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    how though?

    Im trying to lock a database to prevent data corruption due to simultaneous transactions. How can this be taken care of?

  • #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
    You don't need to lock the table. MySQL provides you with atomic transactions. This is all handled for you. You can do it manually but that is pointless. I'm not sure how else I can explain that.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #5
    New Coder
    Join Date
    Jul 2002
    Location
    Adelaide, Australia
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Does this depend on what type the table in question is?

  • #6
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Yes it can depend on what kind of table you have set. Try searching through the MySQL documentation for table locking:

    http://www.mysql.com/doc/en/index.html
    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
    •