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 transaction types supported by FMDB

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "what are the types of transactions supported by FMDB", which is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn what types of transactions are supported by FMDB.

Transaction types supported by FMDB

In a database, transactions can guarantee the integrity of data operations. When there are a large number of concurrent operations, deadlock problems are easy to occur. In SQLite, in order to solve this problem, three transaction modes are provided, which are DEFFERED, IMMEDIATE and EXCLUSIVE.

In DEFFERED mode transactions, no locks are acquired in advance when the transaction begins execution. When the read operation is performed, the SHARED LOCK lock is acquired; when the first write operation is performed, the RESERVED lock is acquired.

In an IMMEDIATE-mode transaction, when the transaction begins to execute, the RESERVED lock is acquired. At this point, other connections can only read.

In an EXCLUSIVE-mode transaction, when the transaction begins to execute, the EXCLUSIVE lock is acquired. This is, other connections cannot do any read and write operations.

FMDB supports both DEFFERED and EXCLUSIVE modes. When the beginTransaction method is used, the EXCLUSIVE schema is used, which is suitable for the situation where the database has less read and write. When the beginDefferedTransaction method is used, the DEFFERED mode is used, which is suitable for scenarios with frequent read and write.

The above is all the content of the article "what are the transaction types supported by FMDB". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report