So, in this section you have seen how to create basic transactions using BEGIN, COMMIT, and ROLLBACK. Remember that not all databases support transactions, and some support transactions different than others. So consult your database server documentation before you jump into a big database project.
Since MySQL does not support transactions on all table types, some tables in a database are transaction-safe, but others (that need to be accessed faster) are not. If a transaction includes data from nontransaction-safe tables, an attempt to ROLLBACK will cause an error. Always be aware of the underlying database structure when writing code to use transactions in MySQL. Code intended to be portable to a variety of systems, possibly where older versions of MySQL are in use, should not use transactions.