Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
4229822d
提交
4229822d
authored
10月 10, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make clear that table level locking is used in PageStore mode
上级
70974acd
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
20 行删除
+14
-20
advanced.html
h2/src/docsrc/html/advanced.html
+14
-20
没有找到文件。
h2/src/docsrc/html/advanced.html
浏览文件 @
4229822d
...
...
@@ -273,10 +273,21 @@ When using the isolation level 'serializable', dirty reads, non-repeatable reads
</li>
</ul>
<h3
>
Table Level Locking
</h3>
<h3
id=
"mvcc"
>
Multi-Version Concurrency Control (MVCC)
</h3>
<p>
The database allows multiple concurrent connections to the same database.
To make sure all connections only see consistent data, table level locking is used by default.
With default MVStore engine delete, insert and update operations only issue a shared lock on the table.
An exclusive lock is still used when adding or removing columns,
when dropping the table, and when using
<code>
SELECT ... FOR UPDATE
</code>
.
Connections only 'see' committed data, and own changes. That means, if connection A updates
a row but doesn't commit this change yet, connection B will see the old value.
Only when the change is committed, the new value is visible by other connections
(read committed). If multiple connections concurrently try to update the same row, the
database waits until it can apply the change, but at most until the lock timeout expires.
</p>
<h3>
Table Level Locking (PageStore engine)
</h3>
<p>
With PageStore engine to make sure all connections only see consistent data, table level locking is used.
This mechanism does not allow high concurrency, but is very fast.
Shared locks and exclusive locks are supported.
Before reading from a table, the database tries to add a shared lock to the table
...
...
@@ -300,23 +311,6 @@ connection will get a lock timeout exception. The lock timeout can be set indivi
for each connection.
</p>
<h2
id=
"mvcc"
>
Multi-Version Concurrency Control (MVCC)
</h2>
<p>
The MVCC feature allows higher concurrency than using (table level or row level) locks.
Delete, insert and update operations will only issue a shared lock on the table.
An exclusive lock is still used when adding or removing columns,
when dropping the table, and when using
<code>
SELECT ... FOR UPDATE
</code>
.
Connections only 'see' committed data, and own changes. That means, if connection A updates
a row but doesn't commit this change yet, connection B will see the old value.
Only when the change is committed, the new value is visible by other connections
(read committed). If multiple connections concurrently try to update the same row, the
database waits until it can apply the change, but at most until the lock timeout expires.
</p>
<p>
This feature is only available with the default MVStore storage engine,
it is not used when using the PageStore storage engine.
</p>
<h2
id=
"clustering"
>
Clustering / High Availability
</h2>
<p>
This database supports a simple clustering / high availability mechanism. The architecture is:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论