Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the methods of starting mysql transactions

2026-02-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "what are the ways to start mysql transactions". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the ways to start mysql transactions?"

Everyone must have come into contact with the transactions in mysql. After we have mastered the basic concepts, we can try to practice transaction startup. The two specific methods are as follows:

1. Display the startup transaction statement, begin or starttransaction. The statement submitted is commit, and the statement for rollback is rollback.

2. Setautocommit=0, which automatically shuts down the thread.

If only one select statement is executed, the transaction starts and does not commit automatically. Until the commit or rollback statement ollback statement is actively executed, or disconnected.

It is recommended that you use setautocommit=1 to start the transaction by displaying sentences.

Long-term transactions can be queried in the innodb_ trx table in the information_schema library, as shown in the following sentence for transactions with a duration longer than 60s.

Example

Select * from information_schema.innodb_trx where TIME_TO_SEC (timediff (now (), trx_started)) > 60 here, I believe you have a deeper understanding of "what are the methods of starting mysql transactions?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

  • How to integrate Swagger2 in SpringBoot

    In this issue, the editor will bring you about how to integrate Swagger2 in SpringBoot. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article. The first step is to add dependency

    12
    Report