1. MySQL transaction support:
Not all engines Support clear transaction processing management.
|
Advantages |
Disadvantages |
MyISAM |
The access speed is fast and there is no requirement for transaction integrity. |
Transactions and Foreign keys are not supported. |
InnoDB |
Supports acid transactions, row-level locks, and concurrency |
The write processing efficiency is lower, and more disk space is occupied to retain data and indexes. |
Memory |
Memory tables can be accessed very quickly. |
Once the server is shut down, data will be lost. |
2. Role
Transaction Processing (Transaction Processing) can be used to maintain the integrity of the database. It can ensure that batch MySQL operations are either completely executed or not executed at all.
3. Several terms:
Transaction is a group of SQL statements.
Rollback: cancels a specified SQL statement.
Commit writes unstored SQL statement results to the database table.
The temporary placeholder (Place-holder) set in the savepoint transaction processing, you can release the rollback for it (different from the process of rolling back the entire transaction ).
4. Transaction Model
A. The implicit transactions caller does not need to execute the begin transaction statement to start the transaction. The database engine automatically opens transactions when executing SQL statements. The caller must call commit or rollback.
B. The explicit transaction (explicit transactions) caller needs to callThe begin transaction statement must call commit or rollback to commit or roll back the transaction.
C. Automatic transactions (autocommit transactions) are automatically defaulted by the system. Each separate SQL statement (SQL statemenet) is a separate transaction and is automatically submitted after the statement is executed. The caller does not need to manually control the transaction process.
References:
MySQL required
Http://justsee.iteye.com/blog/1062914 《About the storage engine of MySQL database"
Thomesca (BEI Cai ):Http://blog.csdn.net/thomescai
(Reprinted and retained)