1. When working on a transaction, if it is found that the current transaction operation is unreasonable, as long as the transaction has not been committed, it can be rolled back to cancel the current transaction, followed by a detailed explanation of the transaction's rollback.
2. In order to demonstrate the rollback operation, on the basis of the previous note case, at this time a account has 1000 yuan, B account also has 1000 yuan, open a transaction, through the UPDATE statement to the a account of 100 yuan to the B account, the specific statement, as follows:
StartTransaction;UpdateAccountSet Money= Money- - whereName='a';UpdateAccountSet Money= Money+ - whereName='b';
After successful execution of the above statement, use the SELECT statement to query A and B accounts, as follows:
At this point a account if do not want to transfer the B account, because the transaction has not yet committed, or can be rolled back, as follows:
MySQL (22): Transaction Management transaction Rollback