Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
dbb83a90
提交
dbb83a90
authored
11月 27, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Close all connections.
上级
97a79050
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
43 行增加
和
6 行删除
+43
-6
TestLob.java
h2/src/test/org/h2/test/db/TestLob.java
+8
-5
TestOutOfMemory.java
h2/src/test/org/h2/test/db/TestOutOfMemory.java
+9
-0
TestPowerOff.java
h2/src/test/org/h2/test/db/TestPowerOff.java
+11
-1
AliasMapTest.java
h2/src/test/org/h2/test/jaqu/AliasMapTest.java
+2
-0
TestConnectionPool.java
h2/src/test/org/h2/test/jdbcx/TestConnectionPool.java
+1
-0
TestXA.java
h2/src/test/org/h2/test/jdbcx/TestXA.java
+1
-0
TestFileLockSerialized.java
h2/src/test/org/h2/test/unit/TestFileLockSerialized.java
+6
-0
TestTools.java
h2/src/test/org/h2/test/unit/TestTools.java
+5
-0
没有找到文件。
h2/src/test/org/h2/test/db/TestLob.java
浏览文件 @
dbb83a90
...
...
@@ -325,7 +325,7 @@ public class TestLob extends TestBase {
trace
(
"shutdown immediately"
);
conn
.
createStatement
().
execute
(
"SHUTDOWN IMMEDIATELY"
);
trace
(
"shutdown done"
);
conn
=
reconnect
(
null
);
conn
=
reconnect
(
conn
);
conn
.
setAutoCommit
(
false
);
sp
=
null
;
}
...
...
@@ -355,7 +355,7 @@ public class TestLob extends TestBase {
conn
.
createStatement
().
execute
(
"DELETE FROM TEST"
);
conn
.
createStatement
().
execute
(
"CHECKPOINT"
);
conn
.
createStatement
().
execute
(
"SHUTDOWN IMMEDIATELY"
);
conn
=
reconnect
(
null
);
conn
=
reconnect
(
conn
);
ResultSet
rs
=
conn
.
createStatement
().
executeQuery
(
"SELECT * FROM TEST"
);
assertTrue
(
rs
.
next
());
rs
.
getInt
(
1
);
...
...
@@ -403,8 +403,7 @@ public class TestLob extends TestBase {
Statement
stat0
=
conn0
.
createStatement
();
stat0
.
executeUpdate
(
"drop table CLOB_ENTITY if exists"
);
stat0
.
getWarnings
();
stat0
.
executeUpdate
(
"create table CLOB_ENTITY (ID bigint not null, DATA clob, CLOB_DATA clob, primary key (ID))"
);
stat0
.
executeUpdate
(
"create table CLOB_ENTITY (ID bigint not null, DATA clob, CLOB_DATA clob, primary key (ID))"
);
stat0
.
getWarnings
();
stat0
.
close
();
conn0
.
getWarnings
();
...
...
@@ -651,7 +650,11 @@ public class TestLob extends TestBase {
private
Connection
reconnect
(
Connection
conn
)
throws
SQLException
{
long
time
=
System
.
currentTimeMillis
();
if
(
conn
!=
null
)
{
try
{
conn
.
close
();
}
catch
(
SQLException
e
)
{
// ignore
}
}
conn
=
getConnection
(
"lob"
);
trace
(
"re-connect="
+
(
System
.
currentTimeMillis
()
-
time
));
...
...
h2/src/test/org/h2/test/db/TestOutOfMemory.java
浏览文件 @
dbb83a90
...
...
@@ -51,8 +51,17 @@ public class TestOutOfMemory extends TestBase {
fail
();
}
catch
(
SQLException
e
)
{
assertEquals
(
ErrorCode
.
OUT_OF_MEMORY
,
e
.
getErrorCode
());
try
{
conn
.
close
();
fail
();
}
catch
(
SQLException
e2
)
{
assertEquals
(
ErrorCode
.
DATABASE_IS_CLOSED
,
e2
.
getErrorCode
());
}
}
freeMemory
();
conn
=
null
;
conn
=
getConnection
(
"outOfMemory"
);
stat
=
conn
.
createStatement
();
ResultSet
rs
=
stat
.
executeQuery
(
"select count(*) from stuff"
);
rs
.
next
();
assertEquals
(
3000
,
rs
.
getInt
(
1
));
...
...
h2/src/test/org/h2/test/db/TestPowerOff.java
浏览文件 @
dbb83a90
...
...
@@ -189,6 +189,11 @@ public class TestPowerOff extends TestBase {
}
assertTrue
(
deleted
);
}
try
{
conn
.
close
();
}
catch
(
SQLException
e
)
{
// ignore
}
conn
=
getConnection
(
url
);
conn
.
close
();
}
...
...
@@ -215,6 +220,11 @@ public class TestPowerOff extends TestBase {
}
((
JdbcConnection
)
conn
).
setPowerOffCount
(
0
);
try
{
conn
.
close
();
}
catch
(
SQLException
e
)
{
// ignore
}
conn
=
getConnection
(
url
);
stat
=
conn
.
createStatement
();
ResultSet
rs
=
stat
.
executeQuery
(
"SELECT COUNT(*) FROM TEST"
);
...
...
@@ -290,7 +300,7 @@ public class TestPowerOff extends TestBase {
}
conn
.
close
();
}
catch
(
SQLException
e
)
{
if
(
e
.
getSQLState
().
equals
(
""
+
ErrorCode
.
SIMULATED_POWER_OFF
))
{
if
(
e
.
getSQLState
().
equals
(
""
+
ErrorCode
.
DATABASE_IS_CLOSED
))
{
// this is ok
}
else
{
throw
e
;
...
...
h2/src/test/org/h2/test/jaqu/AliasMapTest.java
浏览文件 @
dbb83a90
...
...
@@ -40,6 +40,8 @@ public class AliasMapTest extends TestBase {
.
orderBy
(
p
.
productId
).
select
();
assertEquals
(
"[]"
,
products
.
toString
());
db
.
close
();
}
}
h2/src/test/org/h2/test/jdbcx/TestConnectionPool.java
浏览文件 @
dbb83a90
...
...
@@ -50,6 +50,7 @@ public class TestConnectionPool extends TestBase {
Connection
conn2
=
man
.
getConnection
();
assertTrue
(
conn2
.
getAutoCommit
());
conn2
.
close
();
man
.
dispose
();
}
...
...
h2/src/test/org/h2/test/jdbcx/TestXA.java
浏览文件 @
dbb83a90
...
...
@@ -76,6 +76,7 @@ public class TestXA extends TestBase {
Connection
c
=
xa
.
getConnection
();
assertTrue
(!
c
.
getAutoCommit
());
c
.
close
();
xa
.
close
();
}
private
void
testXA
(
boolean
useOneDatabase
)
{
...
...
h2/src/test/org/h2/test/unit/TestFileLockSerialized.java
浏览文件 @
dbb83a90
...
...
@@ -213,6 +213,12 @@ public class TestFileLockSerialized extends TestBase {
printResult
(
stat2
,
"select * from test"
);
conn2
.
close
();
try
{
conn
.
close
();
}
catch
(
SQLException
e
)
{
// ignore
}
}
private
void
testConcurrentReadWrite
()
throws
Exception
{
...
...
h2/src/test/org/h2/test/unit/TestTools.java
浏览文件 @
dbb83a90
...
...
@@ -518,6 +518,11 @@ public class TestTools extends TestBase {
}
catch
(
SQLException
e
)
{
assertKnownException
(
e
);
}
try
{
conn
.
close
();
}
catch
(
SQLException
e
)
{
// ignore
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论