Atomic Commit In SQLite

1.0 Introduction

An important feature of transactional databases like SQLite is "atomic commit". Atomic commit means that either all database changes within a single transaction occur or none of them occur. With atomic commit, it is as if many different writes to different sections of the database file occur instantaneously and simultaneously. Real hardware serializes writes to mass storage, and writing a single sector takes a finite amount of time. So it is impossible to truly write many different sectors of a database file simultaneously and/or instantaneously. But the atomic commit logic within SQLite makes it appear as if the changes for a transaction are all written instantaneously and simultaneously.

SQLite has the important property that transactions appear to be atomic even if the transaction is interrupted by an operating system crash or power failure.

This article describes the techniques used by SQLite to create the illusion of atomic commit.

The information in this article applies only when SQLite is operating in "rollback mode", or in other words when SQLite is not using a write-ahead log. SQLite still supports atomic commit when write-ahead logging is enabled, but it accomplishes atomic commit by a different mechanism from the one describe in this article. See the write-ahead log documentation for additional information on how SQLite supports atomic commit in that context.

2.0 Hardware Assumptions

Throughout this article, we will call the mass storage device "disk" even though the mass storage device might really be flash memory.

We assume that disk is written in chunks which we call a "sector". It is not possible to modify any part of the disk smaller than a sector. To change a part of the disk smaller than a sector, you have to read in the full sector that contains the part you want to change, make the change, then write back out the complete sector.

......

原文地址

转载于:https://www.cnblogs.com/hanhuilee/archive/2013/02/15/5221369.html

根据提供的引用内容,您想要安装atomic-sqlite。根据引用\[1\],在执行yum install atomic-sqlite命令时,出现了错误信息"Package requirements (oniguruma) were not met: No package 'oniguruma' found"。根据引用\[2\],您可以尝试使用yum clean dbcache命令来清除缓存并重新下载安装包。另外,根据引用\[3\],在安装atomic-sqlite之前,您可能需要先安装一些依赖项,如zlib-devel、pcre2-devel、sqlite-devel等。您可以使用以下命令来安装这些依赖项: ``` yum install zlib-devel pcre2-devel sqlite-devel ``` 然后,您可以尝试重新执行yum install atomic-sqlite命令来安装atomic-sqlite。 #### 引用[.reference_title] - *1* [php 源码安装常见问题汇总](https://blog.csdn.net/wfl020315/article/details/124141141)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [CentOS 6.9安装MySQL 5.6 (使用yum安装)](https://blog.csdn.net/weixin_33995481/article/details/94448872)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [OSSEC-hids 主机入侵检测系统概述](https://blog.csdn.net/fured/article/details/112221773)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值