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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:29:03+00:00 2026-05-20T11:29:03+00:00

I have a MySQL DB and an innoDB table in it. I have a

  • 0

I have a MySQL DB and an innoDB table in it. I have a php page that connects, locks the table, does some updates, then unlocks the table. The PHP page is being served up with apache via wamp.

The php page uploads a file to the database. I decided to simulate the system crashing by uploading a file that has a size larger than the memory that is allocated to PHP. This definitely caused this error: allowed memory size of 18874368 bytes exhausted (tried to allocate 6176754 bytes). After that, the tables that were locked during the updates are still locked.

The error I get when I try to access the tables after this error is: Table ‘a’ was not locked with LOCK TABLES. I know that it is a lock problem because I will bring up a SQL prompt and attempt to select from the table that was locked, and it just waits, exactly like it does when the table is locked. If I then kill the Apache process, the statement that I attempted to run in a SQL prompt will finally go through. My guess is that when I kill the Apache process, MySQL realizes that the table lock should be released due to the connection being severed.

Any ideas??

  • 1 1 Answer
  • 1 View
  • 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-20T11:29:04+00:00Added an answer on May 20, 2026 at 11:29 am

    Qoute from: http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html

    If the connection for a client session terminates, whether normally or abnormally, the server implicitly releases all table locks held by the session (transactional and nontransactional). If the client reconnects, the locks will no longer be in effect. In addition, if the client had an active transaction, the server rolls back the transaction upon disconnect, and if reconnect occurs, the new session begins with autocommit enabled.

    As your connection is persistent after the page has executed and completed / disposed of the connection is still present.

    You should not make the connection persistent IMO

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

Sidebar

Related Questions

I have an PHP/MySQL eCommerce application that has a few innoDB tables (for the
I have a MySQL-InnoDB table with 350,000+ rows, containing a couple of things like
I have a MySQL InnoDB table on a RedHat Enterprise Linux 4 server, and
I have a MySQL InnoDB table with a status column. The status can be
I have a MySQL InnoDB table with 238 columns. 56 of them are TEXT
I have an InnoDB MySQL database. When I export a SQL dump, how does
We're using MySQL with Innodb Engine storage. We have an evented environment that sends
I have an InnoDB table in mysql with utf8 charset and utf8_general_ci collation. After
I have a MySQL InnoDB table laid out like so: id (int), run_id (int),
I have a php file that inserts data to a mysql db using pdo.

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.