Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
88e6a94a
提交
88e6a94a
authored
5月 30, 2018
作者:
Andrei Tokar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reduce timeoutMillis from long to int
上级
245ea350
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
9 行增加
和
9 行删除
+9
-9
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-1
Session.java
h2/src/main/org/h2/engine/Session.java
+1
-1
Transaction.java
h2/src/main/org/h2/mvstore/tx/Transaction.java
+3
-3
TransactionStore.java
h2/src/main/org/h2/mvstore/tx/TransactionStore.java
+4
-4
没有找到文件。
h2/src/main/org/h2/engine/Database.java
浏览文件 @
88e6a94a
...
@@ -335,7 +335,7 @@ public class Database implements DataHandler {
...
@@ -335,7 +335,7 @@ public class Database implements DataHandler {
}
}
}
}
public
long
getLockTimeout
()
{
public
int
getLockTimeout
()
{
Setting
setting
=
findSetting
(
Setting
setting
=
findSetting
(
SetTypes
.
getTypeName
(
SetTypes
.
DEFAULT_LOCK_TIMEOUT
));
SetTypes
.
getTypeName
(
SetTypes
.
DEFAULT_LOCK_TIMEOUT
));
return
setting
==
null
?
Constants
.
INITIAL_LOCK_TIMEOUT
:
setting
.
getIntValue
();
return
setting
==
null
?
Constants
.
INITIAL_LOCK_TIMEOUT
:
setting
.
getIntValue
();
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
88e6a94a
...
@@ -169,7 +169,7 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
...
@@ -169,7 +169,7 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
this
.
undoLog
=
new
UndoLog
(
this
);
this
.
undoLog
=
new
UndoLog
(
this
);
this
.
user
=
user
;
this
.
user
=
user
;
this
.
id
=
id
;
this
.
id
=
id
;
this
.
lockTimeout
=
(
int
)
database
.
getLockTimeout
();
this
.
lockTimeout
=
database
.
getLockTimeout
();
this
.
currentSchemaName
=
Constants
.
SCHEMA_MAIN
;
this
.
currentSchemaName
=
Constants
.
SCHEMA_MAIN
;
this
.
columnNamerConfiguration
=
ColumnNamerConfiguration
.
getDefault
();
this
.
columnNamerConfiguration
=
ColumnNamerConfiguration
.
getDefault
();
}
}
...
...
h2/src/main/org/h2/mvstore/tx/Transaction.java
浏览文件 @
88e6a94a
...
@@ -126,7 +126,7 @@ public class Transaction {
...
@@ -126,7 +126,7 @@ public class Transaction {
/**
/**
* How long to wait for blocking transaction to commit or rollback.
* How long to wait for blocking transaction to commit or rollback.
*/
*/
final
long
timeoutMillis
;
final
int
timeoutMillis
;
/**
/**
* Identification of the owner of this transaction,
* Identification of the owner of this transaction,
...
@@ -151,7 +151,7 @@ public class Transaction {
...
@@ -151,7 +151,7 @@ public class Transaction {
Transaction
(
TransactionStore
store
,
int
transactionId
,
long
sequenceNum
,
int
status
,
Transaction
(
TransactionStore
store
,
int
transactionId
,
long
sequenceNum
,
int
status
,
String
name
,
long
logId
,
long
timeoutMillis
,
int
ownerId
,
String
name
,
long
logId
,
int
timeoutMillis
,
int
ownerId
,
TransactionStore
.
RollbackListener
listener
)
{
TransactionStore
.
RollbackListener
listener
)
{
this
.
store
=
store
;
this
.
store
=
store
;
this
.
transactionId
=
transactionId
;
this
.
transactionId
=
transactionId
;
...
@@ -513,7 +513,7 @@ public class Transaction {
...
@@ -513,7 +513,7 @@ public class Transaction {
return
false
;
return
false
;
}
}
private
synchronized
boolean
waitForThisToEnd
(
long
millis
)
{
private
synchronized
boolean
waitForThisToEnd
(
int
millis
)
{
long
until
=
System
.
currentTimeMillis
()
+
millis
;
long
until
=
System
.
currentTimeMillis
()
+
millis
;
int
status
;
int
status
;
while
((
status
=
getStatus
())
!=
STATUS_CLOSED
&&
status
!=
STATUS_ROLLING_BACK
)
{
while
((
status
=
getStatus
())
!=
STATUS_CLOSED
&&
status
!=
STATUS_ROLLING_BACK
)
{
...
...
h2/src/main/org/h2/mvstore/tx/TransactionStore.java
浏览文件 @
88e6a94a
...
@@ -33,7 +33,7 @@ public class TransactionStore {
...
@@ -33,7 +33,7 @@ public class TransactionStore {
/**
/**
* Default blocked transaction timeout
* Default blocked transaction timeout
*/
*/
private
final
long
timeoutMillis
;
private
final
int
timeoutMillis
;
/**
/**
* The persisted map of prepared transactions.
* The persisted map of prepared transactions.
...
@@ -123,7 +123,7 @@ public class TransactionStore {
...
@@ -123,7 +123,7 @@ public class TransactionStore {
* @param dataType the data type for map keys and values
* @param dataType the data type for map keys and values
* @param timeoutMillis lock aquisition timeout in milliseconds, 0 means no wait
* @param timeoutMillis lock aquisition timeout in milliseconds, 0 means no wait
*/
*/
public
TransactionStore
(
MVStore
store
,
DataType
dataType
,
long
timeoutMillis
)
{
public
TransactionStore
(
MVStore
store
,
DataType
dataType
,
int
timeoutMillis
)
{
this
.
store
=
store
;
this
.
store
=
store
;
this
.
dataType
=
dataType
;
this
.
dataType
=
dataType
;
this
.
timeoutMillis
=
timeoutMillis
;
this
.
timeoutMillis
=
timeoutMillis
;
...
@@ -302,7 +302,7 @@ public class TransactionStore {
...
@@ -302,7 +302,7 @@ public class TransactionStore {
* @param ownerId of the owner (Session?) to be reported by getBlockerId
* @param ownerId of the owner (Session?) to be reported by getBlockerId
* @return the transaction
* @return the transaction
*/
*/
public
Transaction
begin
(
RollbackListener
listener
,
long
timeoutMillis
,
int
ownerId
)
{
public
Transaction
begin
(
RollbackListener
listener
,
int
timeoutMillis
,
int
ownerId
)
{
if
(
timeoutMillis
<=
0
)
{
if
(
timeoutMillis
<=
0
)
{
timeoutMillis
=
this
.
timeoutMillis
;
timeoutMillis
=
this
.
timeoutMillis
;
...
@@ -313,7 +313,7 @@ public class TransactionStore {
...
@@ -313,7 +313,7 @@ public class TransactionStore {
}
}
private
Transaction
registerTransaction
(
int
txId
,
int
status
,
String
name
,
long
logId
,
private
Transaction
registerTransaction
(
int
txId
,
int
status
,
String
name
,
long
logId
,
long
timeoutMillis
,
int
ownerId
,
RollbackListener
listener
)
{
int
timeoutMillis
,
int
ownerId
,
RollbackListener
listener
)
{
int
transactionId
;
int
transactionId
;
long
sequenceNo
;
long
sequenceNo
;
boolean
success
;
boolean
success
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论