Luca, >Hi, I need transaction in my db. I installed Mysql max and I'm usind >InnoDb tables. >When an error occurred during the transaction the mysql continue with >the execution. Do I need to "manually" check every query result to >know if query get ok and then in case of error make a rollback? >I thought simply transaction sends an error and rollback automatically >on query error. >Thanks
ANSI specifies that at an SQL error only the current SQL statement is rolled back, not the whole transaction. An exception in MySQL is that a duplicate key error currently only rolls back the insert of the current row. This has relevance only in complex statements of type: INSERT INTO ... SELECT ... Another exception in InnoDB is that a transaction deadlock or a lock wait timeout causes the whole transaction to be rolled back, not just the SQL statement. So, your application has to check the return status of every SQL statement, and decide what to do in case of an error: rollback, commit, or something else. Regards, Heikki http://www.innodb.com/ibman.html --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php