MySQL Forums
Forum List  »  InnoDB

Re: Transactions Not Working
Posted by: E L
Date: June 12, 2008 07:49PM

Your mysql create table statement was defaulting to MyISAM engine which is non-transactional so the behavior you describe is normal.
The 'start transaction', 'begin work', and 'rollback work' have no effect and deliver this error:
'Some non-transactional changed tables couldn't be rolled back'

Details here:
http://dev.mysql.com/doc/refman/5.0/en/non-transactional-tables.html

Try running this instead:

--drop table stock;
CREATE TABLE stock (mykey SERIAL) engine = InnoDB;

begin work;
insert into stock (mykey) values (125);
rollback;
--commit;

select * from stock;

--there should be no rows in the stock table because though you added a row, it rolled back. These commands will tell you what mysql engines are available and what engine your table has:

show engines;
show table status like "stock";

Options: ReplyQuote


Subject
Views
Written By
Posted
6479
March 02, 2008 08:47PM
3248
March 02, 2008 09:18PM
2922
March 02, 2008 10:05PM
Re: Transactions Not Working
2625
E L
June 12, 2008 07:49PM


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.