Is it necessary to write ROLLBACK if queries fail?

Posted by Donator on Stack Overflow See other posts from Stack Overflow or by Donator
Published on 2010-05-01T18:40:31Z Indexed on 2010/05/01 18:47 UTC
Read the original article Hit count: 219

Filed under:
|
|

I write

mysql_query("SET AUTOCOMMIT=0");
mysql_query("START TRANSACTION");

before I write all queries. Then check if all of them are true and then write:

mysql_query("COMMIT");

But if one of query fails, I just pass COMMIT query. So do I really need ROLLBACK function if one of the queries fail? Because without ROLLBACK it also works.
Thanks.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about transactions