Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
31372bc0
提交
31372bc0
authored
7 年前
作者:
Noel Grandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
split the getTransaction() method
I don't like methods that do something completely different with a null parameter
上级
5d1e64ed
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
13 行增加
和
7 行删除
+13
-7
MVPrimaryIndex.java
h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java
+1
-1
MVSecondaryIndex.java
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
+1
-1
MVSpatialIndex.java
h2/src/main/org/h2/mvstore/db/MVSpatialIndex.java
+1
-1
MVTable.java
h2/src/main/org/h2/mvstore/db/MVTable.java
+10
-4
没有找到文件。
h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java
浏览文件 @
31372bc0
...
@@ -66,7 +66,7 @@ public class MVPrimaryIndex extends BaseIndex {
...
@@ -66,7 +66,7 @@ public class MVPrimaryIndex extends BaseIndex {
ValueDataType
valueType
=
new
ValueDataType
(
db
.
getCompareMode
(),
db
,
ValueDataType
valueType
=
new
ValueDataType
(
db
.
getCompareMode
(),
db
,
sortTypes
);
sortTypes
);
mapName
=
"table."
+
getId
();
mapName
=
"table."
+
getId
();
Transaction
t
=
mvTable
.
getTransaction
(
null
);
Transaction
t
=
mvTable
.
getTransaction
Begin
(
);
dataMap
=
t
.
openMap
(
mapName
,
keyType
,
valueType
);
dataMap
=
t
.
openMap
(
mapName
,
keyType
,
valueType
);
t
.
commit
();
t
.
commit
();
if
(!
table
.
isPersistData
())
{
if
(!
table
.
isPersistData
())
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
浏览文件 @
31372bc0
...
@@ -67,7 +67,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex {
...
@@ -67,7 +67,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex {
ValueDataType
keyType
=
new
ValueDataType
(
ValueDataType
keyType
=
new
ValueDataType
(
db
.
getCompareMode
(),
db
,
sortTypes
);
db
.
getCompareMode
(),
db
,
sortTypes
);
ValueDataType
valueType
=
new
ValueDataType
(
null
,
null
,
null
);
ValueDataType
valueType
=
new
ValueDataType
(
null
,
null
,
null
);
Transaction
t
=
mvTable
.
getTransaction
(
null
);
Transaction
t
=
mvTable
.
getTransaction
Begin
(
);
dataMap
=
t
.
openMap
(
mapName
,
keyType
,
valueType
);
dataMap
=
t
.
openMap
(
mapName
,
keyType
,
valueType
);
t
.
commit
();
t
.
commit
();
if
(!
keyType
.
equals
(
dataMap
.
getKeyType
()))
{
if
(!
keyType
.
equals
(
dataMap
.
getKeyType
()))
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/db/MVSpatialIndex.java
浏览文件 @
31372bc0
...
@@ -102,7 +102,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
...
@@ -102,7 +102,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
new
MVRTreeMap
.
Builder
<
VersionedValue
>().
new
MVRTreeMap
.
Builder
<
VersionedValue
>().
valueType
(
valueType
);
valueType
(
valueType
);
spatialMap
=
db
.
getMvStore
().
getStore
().
openMap
(
mapName
,
mapBuilder
);
spatialMap
=
db
.
getMvStore
().
getStore
().
openMap
(
mapName
,
mapBuilder
);
Transaction
t
=
mvTable
.
getTransaction
(
null
);
Transaction
t
=
mvTable
.
getTransaction
Begin
(
);
dataMap
=
t
.
openMap
(
spatialMap
);
dataMap
=
t
.
openMap
(
spatialMap
);
t
.
commit
();
t
.
commit
();
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/db/MVTable.java
浏览文件 @
31372bc0
...
@@ -845,6 +845,16 @@ public class MVTable extends TableBase {
...
@@ -845,6 +845,16 @@ public class MVTable extends TableBase {
// ok
// ok
}
}
/**
* Get a new transaction.
*
* @return the transaction
*/
Transaction
getTransactionBegin
()
{
// TODO need to commit/rollback the transaction
return
transactionStore
.
begin
();
}
/**
/**
* Get the transaction to use for this session.
* Get the transaction to use for this session.
*
*
...
@@ -852,10 +862,6 @@ public class MVTable extends TableBase {
...
@@ -852,10 +862,6 @@ public class MVTable extends TableBase {
* @return the transaction
* @return the transaction
*/
*/
Transaction
getTransaction
(
Session
session
)
{
Transaction
getTransaction
(
Session
session
)
{
if
(
session
==
null
)
{
// TODO need to commit/rollback the transaction
return
transactionStore
.
begin
();
}
return
session
.
getTransaction
();
return
session
.
getTransaction
();
}
}
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论