Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
bc484005
提交
bc484005
authored
17 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
a2a2f8ca
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
34 行增加
和
34 行删除
+34
-34
advanced.html
h2/src/docsrc/html/advanced.html
+11
-11
Database.java
h2/src/main/org/h2/engine/Database.java
+20
-20
Session.java
h2/src/main/org/h2/engine/Session.java
+2
-2
TableData.java
h2/src/main/org/h2/table/TableData.java
+1
-1
没有找到文件。
h2/src/docsrc/html/advanced.html
浏览文件 @
bc484005
...
...
@@ -98,19 +98,19 @@ This database supports the following transaction isolation levels:
<ul>
<li><b>
Serializable
</b><br
/>
This is the default level.
<br
/>
To enable, execute the SQL statement
'SET LOCK_MODE 0'
<br
/>
or append ;LOCK_MODE=1 to the database URL: jdbc:h2:~/test;LOCK_MODE=1
This is the default level.
<br
/>
To enable, execute the SQL statement
'SET LOCK_MODE 0'
<br
/>
or append ;LOCK_MODE=1 to the database URL: jdbc:h2:~/test;LOCK_MODE=1
</li><li><b>
Read Committed
</b><br
/>
Read locks are released immediately.
Higer concurrency is possible when using this level.
<br
/>
This is the isolation level used for many database systems.
<br
/>
To enable, execute the SQL statement
'SET LOCK_MODE 0'
<br
/>
or append ;LOCK_MODE=3 to the database URL: jdbc:h2:~/test;LOCK_MODE=3
Read locks are released immediately.
Higer concurrency is possible when using this level.
<br
/>
This is the isolation level used for many database systems.
<br
/>
To enable, execute the SQL statement
'SET LOCK_MODE 0'
<br
/>
or append ;LOCK_MODE=3 to the database URL: jdbc:h2:~/test;LOCK_MODE=3
</li><li><b>
Read Uncommitted
</b><br
/>
This level means that transaction isolation is disabled.
<br
/>
To enable, execute the SQL statement
'SET LOCK_MODE 0'
<br
/>
or append ;LOCK_MODE=0 to the database URL: jdbc:h2:~/test;LOCK_MODE=0
This level means that transaction isolation is disabled.
<br
/>
To enable, execute the SQL statement
'SET LOCK_MODE 0'
<br
/>
or append ;LOCK_MODE=0 to the database URL: jdbc:h2:~/test;LOCK_MODE=0
</li>
</ul>
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Database.java
浏览文件 @
bc484005
...
...
@@ -764,26 +764,26 @@ public class Database implements DataHandler {
}
void
close
(
boolean
fromShutdownHook
)
{
synchronized
(
this
)
{
this
.
closing
=
true
;
if
(
sessions
.
size
()
>
0
)
{
if
(!
fromShutdownHook
)
{
return
;
}
traceSystem
.
getTrace
(
Trace
.
DATABASE
).
info
(
"closing "
+
databaseName
+
" from shutdown hook"
);
Session
[]
all
=
new
Session
[
sessions
.
size
()];
sessions
.
toArray
(
all
);
for
(
int
i
=
0
;
i
<
all
.
length
;
i
++)
{
Session
s
=
all
[
i
];
try
{
s
.
close
();
}
catch
(
SQLException
e
)
{
traceSystem
.
getTrace
(
Trace
.
SESSION
).
error
(
"disconnecting #"
+
s
.
getId
(),
e
);
}
}
}
}
traceSystem
.
getTrace
(
Trace
.
DATABASE
).
info
(
"closing "
+
databaseName
);
synchronized
(
this
)
{
this
.
closing
=
true
;
if
(
sessions
.
size
()
>
0
)
{
if
(!
fromShutdownHook
)
{
return
;
}
traceSystem
.
getTrace
(
Trace
.
DATABASE
).
info
(
"closing "
+
databaseName
+
" from shutdown hook"
);
Session
[]
all
=
new
Session
[
sessions
.
size
()];
sessions
.
toArray
(
all
);
for
(
int
i
=
0
;
i
<
all
.
length
;
i
++)
{
Session
s
=
all
[
i
];
try
{
s
.
close
();
}
catch
(
SQLException
e
)
{
traceSystem
.
getTrace
(
Trace
.
SESSION
).
error
(
"disconnecting #"
+
s
.
getId
(),
e
);
}
}
}
}
traceSystem
.
getTrace
(
Trace
.
DATABASE
).
info
(
"closing "
+
databaseName
);
if
(
eventListener
!=
null
)
{
eventListener
.
closingDatabase
();
eventListener
=
null
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Session.java
浏览文件 @
bc484005
...
...
@@ -275,7 +275,7 @@ public class Session implements SessionInterface {
undoLog
.
add
(
log
);
}
public
void
unlockReadLocks
()
{
public
void
unlockReadLocks
()
{
for
(
int
i
=
0
;
i
<
locks
.
size
();
i
++)
{
Table
t
=
(
Table
)
locks
.
get
(
i
);
if
(!
t
.
isLockedExclusively
())
{
...
...
@@ -284,7 +284,7 @@ public class Session implements SessionInterface {
i
--;
}
}
}
}
private
void
unlockAll
()
throws
SQLException
{
if
(
Constants
.
CHECK
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/table/TableData.java
浏览文件 @
bc484005
...
...
@@ -300,7 +300,7 @@ public class TableData extends Table implements RecordReader {
if
(
lockExclusive
==
null
)
{
if
(
lockMode
==
Constants
.
LOCK_MODE_READ_COMMITTED
&&
!
Constants
.
MULTI_THREADED_KERNEL
)
{
// READ_COMMITTED read locks are acquired but they are released immediately
// when allowing only one thread, no read locks are required
// when allowing only one thread, no read locks are required
return
;
}
else
if
(!
lockShared
.
contains
(
session
))
{
traceLock
(
session
,
exclusive
,
"ok"
);
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论