Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-03-2003, 04:01 AM #1
- Join Date
- Feb 2003
- Thanked 0 Times in 0 Posts
transaction deadlock when using "autocommit"
Transaction is a big problem in MySQL --> here is what I have done
Since the DB is InnoDB, I tried to "set autocommit=0" so that it can be rollback if it wants, and data will not be actually updated into the file disk unless a "commit" is performed.
$autocommit = "SET autocommit=0";
$setcommit = mysql_query($autocommit);
echo "<font color = yellow> Setcommit = $setcommit </font><BR>";
and then it worked once, but then for the second time, when I go to mySQL and try to do something, it came an error of :
ERROR 1205: Lock wait timeout exceeded; Try restarting transaction
which is probably the deadlock problem...I have to release the lock by
i) show processlist; (and see which thread is sleeping)
ii) kill thread_id;
Does anyone know how to perform transaction with php using InnoDB?
03-03-2003, 06:18 AM #2
- Join Date
- May 2002
- Marion, IA USA
- Thanked 83 Times in 82 Posts
Read our forum rules. Don't crosspost!!!
CodingForums Supreme Overlord
All Hail Spookster