Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
a2cad38b
提交
a2cad38b
authored
8月 15, 2018
作者:
Andrei Tokar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cancel ids release on rollback
address review comments
上级
9bfb3448
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
16 行增加
和
6 行删除
+16
-6
Insert.java
h2/src/main/org/h2/command/dml/Insert.java
+0
-1
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-1
Session.java
h2/src/main/org/h2/engine/Session.java
+15
-4
没有找到文件。
h2/src/main/org/h2/command/dml/Insert.java
浏览文件 @
a2cad38b
...
@@ -154,7 +154,6 @@ public class Insert extends Prepared implements ResultTarget {
...
@@ -154,7 +154,6 @@ public class Insert extends Prepared implements ResultTarget {
Mode
mode
=
session
.
getDatabase
().
getMode
();
Mode
mode
=
session
.
getDatabase
().
getMode
();
int
columnLen
=
columns
.
length
;
int
columnLen
=
columns
.
length
;
for
(
int
x
=
0
;
x
<
listSize
;
x
++)
{
for
(
int
x
=
0
;
x
<
listSize
;
x
++)
{
session
.
startStatementWithinTransaction
();
generatedKeys
.
nextRow
();
generatedKeys
.
nextRow
();
Row
newRow
=
table
.
getTemplateRow
();
Row
newRow
=
table
.
getTemplateRow
();
Expression
[]
expr
=
list
.
get
(
x
);
Expression
[]
expr
=
list
.
get
(
x
);
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
a2cad38b
...
@@ -1084,7 +1084,7 @@ public class Database implements DataHandler {
...
@@ -1084,7 +1084,7 @@ public class Database implements DataHandler {
// otherwise it might be re-used prematurely, and it would make
// otherwise it might be re-used prematurely, and it would make
// rollback impossible or lead to MVMaps name collision,
// rollback impossible or lead to MVMaps name collision,
// so until then ids are accumulated within session
// so until then ids are accumulated within session
session
.
releaseDatabaseObjectId
(
id
);
session
.
scheduleDatabaseObjectIdForRelease
(
id
);
}
else
{
}
else
{
// but PageStore, on the other hand, for reasons unknown to me,
// but PageStore, on the other hand, for reasons unknown to me,
// requires immediate id release
// requires immediate id release
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
a2cad38b
...
@@ -166,7 +166,7 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
...
@@ -166,7 +166,7 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
/**
/**
* Set of database object ids to be released at the end of transaction
* Set of database object ids to be released at the end of transaction
*/
*/
private
final
BitSet
idsToRelease
=
new
BitSet
()
;
private
BitSet
idsToRelease
;
public
Session
(
Database
database
,
User
user
,
int
id
)
{
public
Session
(
Database
database
,
User
user
,
int
id
)
{
...
@@ -634,7 +634,15 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
...
@@ -634,7 +634,15 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
return
command
;
return
command
;
}
}
void
releaseDatabaseObjectId
(
int
id
)
{
/**
* Arranges for the specified database object id to be released
* at the end of the current transaction.
* @param id to be scheduled
*/
void
scheduleDatabaseObjectIdForRelease
(
int
id
)
{
if
(
idsToRelease
==
null
)
{
idsToRelease
=
new
BitSet
();
}
idsToRelease
.
set
(
id
);
idsToRelease
.
set
(
id
);
}
}
...
@@ -757,8 +765,10 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
...
@@ -757,8 +765,10 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
removeLobMap
=
null
;
removeLobMap
=
null
;
}
}
unlockAll
();
unlockAll
();
if
(
idsToRelease
!=
null
)
{
database
.
releaseDatabaseObjectIds
(
idsToRelease
);
database
.
releaseDatabaseObjectIds
(
idsToRelease
);
idsToRelease
.
clear
();
idsToRelease
=
null
;
}
}
}
/**
/**
...
@@ -775,6 +785,7 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
...
@@ -775,6 +785,7 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
if
(!
locks
.
isEmpty
()
||
needCommit
)
{
if
(!
locks
.
isEmpty
()
||
needCommit
)
{
database
.
commit
(
this
);
database
.
commit
(
this
);
}
}
idsToRelease
=
null
;
cleanTempTables
(
false
);
cleanTempTables
(
false
);
if
(
autoCommitAtTransactionEnd
)
{
if
(
autoCommitAtTransactionEnd
)
{
autoCommit
=
true
;
autoCommit
=
true
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论