Is virtual reading non-repeatable reading?
Virtual reading and non-repeatable reading are different.
Dirty reads dirty reads: This event occurs when a transaction reads data that has not yet been committed. For example: Transaction 1 modifies a row of data, and then Transaction 2 reads the modified row before Transaction 1 commits the modification operation. If Transaction 1 rolls back the modification operation, then the data read by Transaction 2 can be regarded as never existing.
Non-repeatable reads: This event occurs when a transaction reads the same row of data twice, but the data obtained each time is different. For example: Transaction 1 reads a row of data, and then Transaction 2 modifies or deletes the row and submits the modification operation. When Transaction 1 tries to reread the row, it gets different data values (if the row was updated) or finds that the row no longer exists (if the row was deleted).
Phantom read phantom read: This event will occur if a row of data that meets the search conditions appears in a subsequent read operation, but the row of data does not belong to the original data. For example: Transaction 1 reads some rows that meet a certain search condition, and then Transaction 2 inserts a new row that matches Transaction 1's search condition. If Transaction 1 re-executes the query that produced the original rows, it will get different rows.
The transaction scenario is as follows:
For the same bank account A has 200 yuan, A withdraws 100 yuan, and B transfers 100 yuan to account B. If the transaction is not isolated, the following problems may occur:
1. The first type of lost update: first, when A withdraws money, there is 200 yuan in the account, and at the same time, B transfers 200 yuan, and then A and B operate at the same time, and A operates If 100 yuan is successfully withdrawn, B's operation fails and is rolled back. The final amount in the account is 200 yuan. In this way, A's operation is overwritten, and the bank loses 100 yuan.
2. Dirty reading: A withdraws 100 yuan but does not submit it. B makes a transfer and finds that there is 100 yuan left in the account. This is A giving up the operation and rolling back. B submits the normal operation, and the final amount in the account is 0 yuan. B reads A's dirty data, and the customer loses 100 yuan.
3. Virtual read: Similar to dirty read, it is aimed at the reading problem during the insertion operation. For example, the deposit C of 100 yuan is not submitted. At this time, the bank makes a report for statistical inquiry and the account is 200 yuan, and then C submitted it. At this time, the bank found that the account balance was 300 yuan. It was unable to determine which one should be used as the basis?
Everyone seems to think that statistics must be updated from time to time, which is normal; but it is not normal if the statistics are in a transaction. For example, one of our statistical applications needs to separate the statistical results. Output to the computer screen and the disk file of a computer on the remote network. In order to
improve performance and user response, we divide it into two threads. At this time, the statistical data completed first and completed later may be inconsistent, so we I don’t know which one should prevail.
4. Non-repeatable reading: A and B both started to check that the account was 200 yuan at the same time. A first started to withdraw 100 yuan and submit it. At this time, B made another query when preparing for the final update and found that the result was 100 yuan, then B will be very confused, not knowing whether to change the account to 100 or 0.
The difference between dirty reading and dirty reading is that dirty reading reads the uncommitted dirty data of the previous transaction, while non-repeatable reading re-reads the data that has been submitted by the previous transaction.
5. The second type of lost update: It is a special case of non-repeatable reading. As above, B does not make a second query but directly completes the operation. The final amount in the account is 100 yuan, and A's operation is overwritten. If it falls, the bank loses 100 yuan. It feels similar to the first type of lost update.
The above is the detailed content of Does virtual reading mean non-repeatable reading?. For more information, please follow other related articles on the PHP Chinese website!

The domestic AI dark horse DeepSeek has risen strongly, shocking the global AI industry! This Chinese artificial intelligence company, which has only been established for a year and a half, has won wide praise from global users for its free and open source mockups, DeepSeek-V3 and DeepSeek-R1. DeepSeek-R1 is now fully launched, with performance comparable to the official version of OpenAIo1! You can experience its powerful functions on the web page, APP and API interface. Download method: Supports iOS and Android systems, users can download it through the app store; the web version has also been officially opened! DeepSeek web version official entrance: ht

At the beginning of 2025, domestic AI "deepseek" made a stunning debut! This free and open source AI model has a performance comparable to the official version of OpenAI's o1, and has been fully launched on the web side, APP and API, supporting multi-terminal use of iOS, Android and web versions. In-depth search of deepseek official website and usage guide: official website address: https://www.deepseek.com/Using steps for web version: Click the link above to enter deepseek official website. Click the "Start Conversation" button on the homepage. For the first use, you need to log in with your mobile phone verification code. After logging in, you can enter the dialogue interface. deepseek is powerful, can write code, read file, and create code

DeepSeek: How to deal with the popular AI that is congested with servers? As a hot AI in 2025, DeepSeek is free and open source and has a performance comparable to the official version of OpenAIo1, which shows its popularity. However, high concurrency also brings the problem of server busyness. This article will analyze the reasons and provide coping strategies. DeepSeek web version entrance: https://www.deepseek.com/DeepSeek server busy reason: High concurrent access: DeepSeek's free and powerful features attract a large number of users to use at the same time, resulting in excessive server load. Cyber Attack: It is reported that DeepSeek has an impact on the US financial industry.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
