From: http://www.gosoa.com.cn/php-mysql%E4%BA%8B%E5%8A%A1%E8%AF%A6%E8%A7%A3
Before talking about PhP MySQL transactions, You can first understand the differences between PHP MySQL and mysqli.
First, both functions are used to process
MySQL advanced technology-transaction processing and lock, mysql Transaction ProcessingMySQL advanced technology-transaction processing and lockHow does mysql lock a row of data with transactions and locks so that two users are not allowed to read a
MySQL transaction and isolation levelPreface:
I never thought of writing a good title. I want some important MySQL content. I have met either of the two interviews, but it seems that it is not appropriate to directly use the MySQL title. Simply
PHP and MYSQL transaction processing and PHPMYSQL Transaction Processing
/*There are two main methods to process MYSQL transactions.1. Use begin, rollback, and commit to implementStart a transactionRollback transaction rollbackCommit transaction
MySQL transaction table and non-transaction tableMySQL transaction table and non-transaction tableWhen viewing the max_binlog_stmt_cache_size parameter explanation, there is such a sentence If nontransactional statements within a transaction require
Several steps for PHP+MYSQL transaction processing:1. Turn off automatic submission2. Open transaction Processing3. The exception will automatically throw the exception prompt and roll back4. Turn on automatic submission
Note: MySQL has only this
Transaction
BEGIN;COMMIT;A piece of code that modifies the two fields of the current table
First find it, save it in a variable, and add it to the value of the second field.
The code is as follows
Copy Code
Projects often use the ID, such as UID, below for the use of MySQL transaction characteristics to achieve concurrent security of the ID, interested friends can refer to the following You will often use your own ID in your project, such as UID,
1. Transaction processing and concurrency1.1. Basic knowledge and related concepts1) All table types can use locks, but only InnoDB and BDB have built-in transactional functionality.2) Start the transaction using begin, use commit to end the
Ignore other questions and go directly to the technical interview
What kind of Java GC is configured in your company server?Java GC is divided into four types, namely
-XX:+USESERIALGC Serial garbage collector
-XX:+USEPARALLELGC
A transaction did not commit to the B transaction is equal to not do get the previous dataBut the query in a transaction is the data after the operation.Data that is not submitted is only visible to itself and is not being update to the
The SQL standard defines a Class 4 isolation level, which includes specific rules to define which changes within and outside the transaction are visible and which are not. Low-level isolation levels generally support higher concurrency processing
Transaction controlIn general, MySQL turns on the transaction autocommit feature by default, and each SQL execution commits the transaction. You can turn off the transaction autocommit feature by using the following statement.Show session variables
Knowledge Points:What is transaction processing?When a database table is designed in a tree-like structure, we add, delete, and change a table, which may require the same operation on another table, and in order to ensure that multiple SQL can
MySQL's Lock1. Shared lock, which is read lock, can be forced by select ... lock in share mode, the default SELECT statement is unlocked2. Exclusive lock, that is, write lock, you can force write lock by select ... for UPDATE, INSERT, UPDATE, DELETE
4. Pdostatment objects4.1 Member methods in PdostatmenFetchFetchall4.2 Set the array type that returns the resultPdo::fetch_assocPdo::fetch_numPdo::fetch_bothPdo::fetch_objstdclass padding Properties4.3 PDO processing result set mode1. Fetch
Transactions are required to meet 4 conditions (ACID): atomicity (autmic), consistency (consistency), isolation (isolation), persistence (durability)Atomicity (autmic): The transaction is in execution, to do "either do it or do it all!" ", which
Transactions: Treat the business process as a minimal business processing unitFor example: Friend transferThere are four main features of transactions:Atomicity: the smallest unit with function is inseparable;Persistent: The correct data for
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.