Access database thread-related tests for transactions

Source: Internet
Author: User
Tags thread access database
One, in the transaction a thread (transaction), B thread
① the same connection operation is the same table, if the A-thread operation is rolled back, the operation of the B-thread is also rolled back
② the same connection operation two different tables, if the operation of a thread is rolled back, the operation of the B thread will also be rolled back
③ two different connections to the same database cannot operate on the same table (will cause a crash)
④ two different connection operations of the same database two different tables, if the operation of a thread is rolled back, the operation of the B thread will not be rolled back
⑤ main thread, using two different CRecordset operations created by the same connection in the transaction two tables, two table operations are rolled back if an exception occurs

⑥ main thread, two tables in a transaction using two different CRecordset created by different connections, the database operation for which the transaction connection was not started succeeds


Second, non-transactional (throws an exception in a)

① the same connection operation on the same table, the A-thread operation was unsuccessful (the operation succeeded before the exception was thrown), but the operation of the B-thread succeeded


Third, the database connection cannot be opened before the transaction starts


Just some of your own tests, not exactly what you can add.

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.