Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f22ff7e4
提交
f22ff7e4
authored
5月 11, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Hide the feature FILE_LOCK=NO a bit, so that hopefully less people will use it.
上级
8414de9c
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
17 行删除
+12
-17
faq.html
h2/src/docsrc/html/faq.html
+2
-2
features.html
h2/src/docsrc/html/features.html
+10
-15
没有找到文件。
h2/src/docsrc/html/faq.html
浏览文件 @
f22ff7e4
...
...
@@ -151,8 +151,8 @@ than reliability. Those dangerous features are:
<ul><li>
Using the transaction isolation level
<code>
READ_UNCOMMITTED
</code>
(
<code>
LOCK_MODE 0
</code>
) while at the same time using multiple
connections.
</li><li>
Disabling database file protection using
<code>
FILE_LOCK=NO
</code>
in the database URL
.
</li><li>
Disabling database file protection using
(setting
<code>
FILE_LOCK
</code>
to
<code>
NO
</code>
in the database URL)
.
</li><li>
Disabling referential integrity using
<code>
SET REFERENTIAL_INTEGRITY FALSE
</code>
.
</li></ul>
<p>
...
...
h2/src/docsrc/html/features.html
浏览文件 @
f22ff7e4
...
...
@@ -500,8 +500,7 @@ This is achieved using different database URLs. Settings in the URLs are not cas
<tr>
<td><a
href=
"#database_file_locking"
>
File locking methods
</a></td>
<td
class=
"notranslate"
>
jdbc:h2:
<
url
>
;FILE_LOCK={NO|FILE|SOCKET}
<br
/>
jdbc:h2:file:~/quickAndDirty;FILE_LOCK=NO
<br
/>
jdbc:h2:
<
url
>
;FILE_LOCK={FILE|SOCKET|NO}
<br
/>
jdbc:h2:file:~/private;CIPHER=XTEA;FILE_LOCK=SOCKET
<br
/>
</td>
</tr>
...
...
@@ -684,14 +683,18 @@ the database terminates, this lock file is deleted.
The following file locking methods are implemented:
</p>
<ul>
<li>
The default method is
'file'
and uses a watchdog thread to
<li>
The default method is
<code>
FILE
</code>
and uses a watchdog thread to
protect the database file. The watchdog reads the lock file each second.
</li><li>
The second method is 'socket' and opens a server socket. The socket method does
not require reading the lock file every second. The socket method should only be used
if the database files are only accessed by one (and always the same) computer.
</li><li>
The second method is
<code>
SOCKET
</code>
and opens a server socket.
The socket method does not require reading the lock file every second.
The socket method should only be used if the database files
are only accessed by one (and always the same) computer.
</li><li>
It is also possible to open the database without file locking;
in this case it is up to the application to protect the database files.
</li></ul>
Failing to do so will result in a corrupted database.
Using the method
<code>
NO
</code>
forces the database to not create a lock file at all.
Please note that this is unsafe as another process is able to open the same database,
possibly leading to data corruption.
</li></ul>
<p>
To open the database with a different file locking method, use the parameter
<code>
FILE_LOCK
</code>
.
...
...
@@ -701,14 +704,6 @@ The following code opens the database with the 'socket' locking method:
String url = "jdbc:h2:~/test;FILE_LOCK=SOCKET";
</pre>
<p>
The following code forces the database to not create a lock file at all. Please note that
this is unsafe as another process is able to open the same database, possibly leading to
data corruption:
</p>
<pre>
String url = "jdbc:h2:~/test;FILE_LOCK=NO";
</pre>
<p>
For more information about the algorithms, see
<a
href=
"advanced.html#file_locking_protocols"
>
Advanced / File Locking Protocols
</a>
.
</p>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论