Monday, October 11, 2010

SYBASE Services


Services

This article describes the database transaction isolation level on the impact of the lock, by comparing the transaction isolation level 0 and 1, to understand the relationship between the lock and dirty time.

Experiment: set 0 and 1 respectively, isolation level, the implementation of two different but related issues there. The experimental environment is as follows:

1, the right to access the user database (in this case aca_database) and modify database tables and queries have permissions.

2, the database contains tables auths, including salary column (data type is money), there is a certain amount of data (in 1 million lines).

Steps:

1, as in the same machine, can be performed separately two "SQL Advantage", respectively legitimate account login, prepare their own implementation of a transaction.

2 Open the user interface in their database aca_database, set the isolation level to 1 (also goes for the default value):

set transaction isolation level 1, see the current isolation level using select @ @ isolation

3, the implementation of the first two sentences of the first transaction, suspending and later committed or rolled back.

begin transaction

update auths set salary = salary +100

commit transaction

(Rollback transaction)

4, the implementation of the second transaction select sum (salary) from auths

5, the end of the normal execution of a transaction, but only changes in the memory buffer to complete the transaction and did not really end, do not release the corresponding lock, the second transaction in the wait state. Executable sp_lock and sp_who command.

6, step 3 in order to submit or rollback, the second transaction to be implemented.

7, to change the transaction isolation level is 0, repeat steps 3-4. No change in the first transaction, the second transaction will soon come under the first transaction is made to modify the data results, it seems that the implementation of the response on the first transaction is not subject to influence.

8 Repeat step 6 the end.

Through the above experiments we know that:

1, transaction isolation level 0 allows dirty read transaction isolation level 1, does not allow dirty read, but rather wait for real before the end of a modified transaction and release the lock.

2, isolation level 0, if the modification is to rollback the last transaction, then the query time transaction will not read the correct data.

3, satisfied that there is no rollback transaction possible, and called for greater efficiency and parallel implementation, only then we may consider setting isolation level to 0.






Recommended links:



OPTIONAL U disk watch "shell" scam



Looking For A Breakthrough Signing Strangers



quot driveletteraccess quot tfswshx.dll error



Fireworks produced way back in effect



New Hobby



Record 2 Room To Visit A New Generation Of IDC



How do we advertise for white-collar?



ASF to MPG



MKV to WMV



Alliance with the MERGER as



Beautiful hand experience With lighting effects with the old photo magic



Articles About PIMS And Calendars



MP4 to WMP



Three Kingdoms OL "I Am 40 (anti-war) To Talk About The Experience



Shenzhen, Hong Kong: forerunner of attitude



3 comments:

  1. Apart from the romance that fills the air,
    Positano is also the excellent honeymoon getaway. Fashionable technologies have been taking part in an much more and additional important
    element in the lives of persons all earlier
    mentioned the earth, and not just with emails
    and corporation options. Relationship counseling will help couples figure
    out and clear up conflicts and boost their relationships.


    Here is my blog - videography

    ReplyDelete
  2. I every time used to study piece of writing in news papers but now as I am a
    user of webb therefore from now I am using net for articles or reviews, thanks to
    web.

    My homepage - clash of clans hack tool (Itsclashofclanshacks.tumblr.com)

    ReplyDelete
  3. Keep on working, great job!

    my page ... linden method anxiety cure

    ReplyDelete