12/04/2010
Hi there,
I back again this class for theoretical exam:)
Concurrency Problems
1. Concurrency problems
If locking is not available and several users access a database concurrently, problems may occur
If their transactions use the same data at the same time.
Lost updates.
Uncommitted dependency (dirty read).
Inconsistent analysis (non-repeatable read).
http://msdn.microsoft.com/en-us/library/aa213029%28SQL.80%29.aspx
2. Lost update
Successfully completed update is overridden by another user.
3. Uncommitted dependency (dirty read).
4. Inconsistent analysis (non-repeatable read).
5. Inconsistent analysis (non-repeatable read) example
Records that appear in a set being read by another transaction.
http://db.apache.org/derby/docs/10.0/manuals/develop/develop71.html
7. Phantom Reads example
8. Back to Marcia's Drycleaning
Stored Procedure 01
Insert a new record in SERVICE table
Stored Procedure 02
Insert a new record in ORDER and ORDER_ITEM table
Also select data from CUSTOMER and SERVICE
Stored Procedure 03
Insert a new record in CUSTOMER table
Concurrency problems may occur between 01 and 02, between 02 and 03.
9. Dirty read SP01(SP03)and SP02
SP02 trusts SERVICE table data, but it has not been committed yet.
10. Non-repeatable reads SP02 and User Operation
Non-repeatable reads may occur between SP02 and other user operations.
10. Phantom read SP01(SP03) and SP02
SP02 trusts SERVICE table data, but it has not been committed yet.
11. Appropriate concurrency control
SP01 INSERT SERVICE
Read Committed
SP03 INSERT CUSTOMER
Read Committed
SP02 INSERT ORDER and SELECT All table
Serializable
0 件のコメント:
コメントを投稿