Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 951957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:49:03+00:00 2026-05-15T23:49:03+00:00

What is Locking in MySQL (or any RDBMS) and when would you use it?

  • 0

What is Locking in MySQL (or any RDBMS) and when would you use it? A Layman explanation with a Example would be great!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:49:04+00:00Added an answer on May 15, 2026 at 11:49 pm

    We have a joint bank account with a balance of $200

    I go to the ATM and put my card into the machine, the machine checks that I have a balance of $200

    Meanwhile, you go into the bank and ask for $50, the teller brings up your account and confirms that you have the money.

    I request a withdrawal of $200, the machine counts my money gives me $200 and sets my balance at $0

    The teller counts your money and gives you the $50, the system then updates the balance on the account as $150 ($200 – $50 withdrawl).

    So now we have $250 cash and $150 left in the account. $200 profit.

    The database should have used locks to prevent both transactions occuring at the same time.

    The problem is if you handle every transaction in that way then we would lose concurrency and performance would suffer, so there are different transaction isolation levels that are used depending on the scenario, for instance you might not care that someone can modify data that has been read in a transaction.

    http://en.wikipedia.org/wiki/Isolation_%28database_systems%29

    You should learn these and understand the scenarios where they are applicable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to start my mysql server with the --external-locking option. As mysqld
I would like to know if there are any ways one can perform 'locking'
I am Looking for a Function that insert Any form values to mysql ,
I have a strange issue (at least for me :)) with the MySQL's locking
Is there any way via a MySQL query to get the locked tables? I
Does MySQL have any equivalent feature to Oracle's virtual private databases in 10g. It
I haven't found any MYSQL many-to-many relationships examples here and in google. What I
I'm looking for an easy way to generate a MySQL DATETIME from any type
Is there any Free SQLite GUI tool? something like Workbench for MySQL? I've been
Possible Duplicate: Run MySQLDump without Locking Tables My website uses a mysql 5 database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.