Ado.net Series quiz about Transaction isolation levels
Source: Internet
Author: User
The proposed problem of ADO:
Some people, in order to avoid transactional concurrency problems, set the isolation level of the transaction to the highest level serilizable, resulting in unexpected problems.
Suppose there is a table T1
There is only one field field2 varchar (20) type.
He executed a code in the code:
Set TRANSACTION ISOLATION level serializable
BEGIN Tran
SELECT * FROM t1
WAITFOR DELAY ' 00:00:30 '
INSERT into T1 values (' 123 ')
If @ @error =0
Commit Tran
Else
Rollback Tran
Problem:
1. Do not rush to execute this code, like this code more than a person to execute at the same time what is the problem
2. He violated those principles of database transaction design.
Once you've solved it, you'll find that it's not used properly, it's easy to have problems, even serious consequences.
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.