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 532275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:23:17+00:00 2026-05-13T09:23:17+00:00

I had been working on Preorder tree traversal algorithm as a part of my

  • 0

I had been working on “Preorder tree traversal algorithm” as a part of my daily task. What I came across was that for MySQL, we need to lock a table and after insertion or deletion of any entry, we need to unlock the particular table (I succeeded in my task though)…. I just wonder why we do this? Apart from this case, where else do you think this can be used in case its frequently in use ?

  • 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-13T09:23:17+00:00Added an answer on May 13, 2026 at 9:23 am

    You need to lock a table if you don’t want its contents to change while you are doing whatever you are.

    So in your case, I assume that you would not want the table to change while you do your traversal (I assume your table data forms some sort of tree).

    So one option you have is: LOCK the table, COPY its contents to another table, UNLOCK it, and operate on the copy.

    If your original table is small enough, you can even make your temp table in-memory.

    Beware: locking tables can cause other scripts that use the table to wait! Be sure that your operations will not take a lot of time.

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

Sidebar

Related Questions

Alan Kay was quoted several years ago to the effect that there had been
I had been happily coding along on a decent sized solution (just over 13k
I had been steering away from C# for a while, because it was just
I had been wondering for quite some time on how to manager memory in
I've had been hearing about test driven development for a couple years now, and
Our Dev team had been developing enterprise web page more than 2 years ago.
The ability to use BitKeeper free of charge had been withdrawn by the copyright
(Jeopardy-style question, I wish the answer had been online when I had this issue)
If our server (running on a device) starts before a DHCP lease had been
I have a new ASP.NET MVC project (my first), and I had been running

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.