10. mysql transaction Introduction

Source: Internet
Author: User

10. mysql transaction Introduction

1. myisam and memory support table-level locking BDB page-level locking Innodb row-level locking 2. table lock (not a table) lock table read // read-only table lock, that is, after the lock is executed, the operation in the lock can only be read operation select * from ..... unlock tables; lock table write // read/write table lock, readable and writable insert... update... select... delete... unlock tables; PS: after the table is locked, other connection operations will be suspended until the locked connection is unlocked. If the TM remains unlocked, it will be finished !!! 3. transaction begin | start transaction rollback | commit submit transaction PS: If you are executing a mysiam table Lock operation, but you have enabled the transaction during the table Lock operation, the lock will be unlocked.

 


What is a mysql database transaction? create table xxxx (...) engine innoDB when creating a table; a statement indicates that innoDB supports transactions when creating an engine.
Start transaction: start transaction;
Write an SQL statement as long as the transaction is not committed, there is a commit explicit commit, and implicit commit. If the SQL statement is not written properly, commit and commit the transaction; A problem occurs in the preceding SQL statement, which means that Rollback is more than a batch change of coins in a SQL statement. Rollback means that when the transaction is started, the status indicates that the SQL operation of the transaction is enabled, and the transaction has not been restarted.
Note: When the transaction commit or rollback ends
Mysql transaction processing? Disable Automatic submission insert data temporarily written into database reserved temporary region submission

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.