How to Use UPDATE nowait in oracle

Source: Internet
Author: User

1. UPDATE nowait: query a piece of data and enable database transactions for it. If no lock is applied to the current data, the system returns the correct result and locks the current data. If the queried data is already in the transaction, the system locks the data. However, an error message is returned, indicating that the data has been locked. SQL statement:

SQL code:

SELECT *

FROM hold_mc_site_product_pic pic

WHERE image. id = 730127 for update nowait

2. Concurrent applications with multiple threads. First, the data to be processed is queried, and database-level locks are added. After processing, the data is written to the database. Commit a transaction. It can effectively control data consistency in the case of concurrency.

Related Article

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.