Lock upgrade failure will cause a deadlock

Source: Internet
Author: User
Tags db2 sql error sql error

---- Start

DB2 SQL error: sqlcode:-911, sqlstate: 40001, sqlerrmc: 2

Message: The current transaction has been rolled back because of a deadlock or timeout. Reason code "2 ".

Yesterday, I executed a simple SQL statement but failed to execute it. The above error is a deadlock. Since it is a deadlock, You can execute it later. After waiting for a while, the deadlock still persists. Which transaction is locked with which transaction? After half a day of query, I found that the data volume updated in the original SQL statement was very large, resulting in a lock upgrade, and then the lock upgrade failed again, resulting in a deadlock. The original lock upgrade failure will cause a deadlock. Therefore, we should usually adjust the locklist and maxlock parameters to a large enough value to avoid lock wait and lock upgrade, so as to maximize the database concurrency.

--- For more information, see:DB2 Essentials

----Statement: indicate the source for reprinting.

---- Last updated on 2010.3.15

---- Written by shangbo on 2010.3.15

---- End

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.