List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:October 14 1999 3:08pm
Subject:LOCK and UNLOCK TABLES
View as plain text  
>>>>> "Name" == Name Removed <name@removed> writes:

Name> While searching for an answer for my questions...I found this posting @:
Name> http://www.geocrawler.com/archives/3/1/1999/3/0/1072089/

Name> However, noone ever replied to poor Sophie.  And since Geocrawler
Name> doesn't provide you with the author's e-mail address...I couldn't e-mail
Name> her to see if she ever got this fixed.

Name> So...I'm reposting her question origially placed in march...with the
Name> hopes that perhaps someone will have an answer this time around.  If
Name> anyone knows Sophie..thank her for me, and ask her if she's got a fix.

Name> I've got the same dilemma as she had..and I'm wondering how to handle
Name> it.  (Yes..I know...get Postgre)  That's not the answer I'm looking for.

Name> <snip>
Name> Message: 1072089
Name> FROM: Sophie BLONDEL
Name> DATE: 03/11/1999 09:11:45
Name> SUBJECT: [PHP3] LOCK and UNLOCK TABLES 
Name> I`m using  following mysql statements in my php page :
>> LOCK TABLES mytable WRITE;
>> ....
>> UNLOCK TABLES
Name> However when you try to access a table that is not locked while an other
Name> table is locked, you get an error. My problem is  whenever you make an
Name> error between a lock statement and an unlock statement, the tables keep
Name> staying locked. The only way to get out is to stop the mysql server,
Name> then restart it. How can I unlock tables without restarting mysql
Name> server?

Hi!

The problem is more that you have to have some error checking in your
program.  You will get the same kind of problems with any other SQL
server if you are using transactions and abort without a
'commit/abort'

If you just close the connection if you get an error (or don't use
persistent connection) then MySQL will automaticly unlock the table
for you.

Regards,
Monty
Thread
LOCK and UNLOCK TABLESName Removed13 Oct
  • LOCK and UNLOCK TABLESMichael Widenius14 Oct