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

I have modified a working Windows service that had always been starting beforehand. After
I had been working on server side(c#) for a couple of years. But now
I have been working on a json decode issue (which I have already had
I've been working at this for two days and have not had much luck.
I've been working for some time on (Java) Bytecode, however, it had never occurred
From previous experience I had been under the impression that it's perfectly legal (though
I have been coding a design I had been working on for a week
My git repository was suddenly broken. I had been working as usual, but when
I had been working on a key-logger in C#, windows forms, and I'm stuck
I have been working on rails project, which had been made using noSql(Mongoid). Every

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.