MySQL Forums
Forum List  »  InnoDB

Cannot start TRANSACTION
Posted by: Haseeb Iqbal
Date: June 05, 2005 07:41PM

i am using MYSQL 5.0.3 beta-standard.

i wanted to run a few commands and rollback if any of the commands failed. but i noticed that if i tried to rollback. it just wouldnt do. i was using php so thought maybe php is having problems. i created a sql script and tried to run the commands and rollback but with no luck. then i tried this
=====================================
START TRANSACTION;
SELECT @@autocommit AS AutoCommit;
ROLLBACK;
====================================
AutoCommit always returns 1. which means Autocommit is turned on, then i tried to chnage the above to SET autocommit=1; but after i executed the command i sartted getting

Error: 1192 SQLSTATE: HY000 (ER_LOCK_OR_ACTIVE_TRANSACTION)

Message: Can't execute the given command because you have active locked tables or an active transaction
i was using this script
=====================================
SET AUTOCOMMIT=0;
SELECT @@autocommit AS AutoCommit;
ROLLBACK;
====================================

what am i doing wrong and what can i do tto fix this issue

Thanks

Options: ReplyQuote


Subject
Views
Written By
Posted
Cannot start TRANSACTION
3021
June 05, 2005 07:41PM
2087
June 30, 2005 05:44PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.