Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
5ff0818d
提交
5ff0818d
authored
9月 26, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
783321d4
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
2740 行增加
和
2503 行删除
+2740
-2503
_docs_de.utf8.txt
h2/src/docsrc/text/_docs_de.utf8.txt
+691
-568
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+577
-568
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+892
-769
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+571
-568
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+0
-25
TestLinkedTable.java
h2/src/test/org/h2/test/db/TestLinkedTable.java
+3
-3
TestLob.java
h2/src/test/org/h2/test/db/TestLob.java
+6
-2
没有找到文件。
h2/src/docsrc/text/_docs_de.utf8.txt
浏览文件 @
5ff0818d
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
5ff0818d
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
5ff0818d
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
5ff0818d
差异被折叠。
点击展开。
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
5ff0818d
...
@@ -145,31 +145,6 @@ java org.h2.test.TestAll timer
...
@@ -145,31 +145,6 @@ java org.h2.test.TestAll timer
/*
/*
Thanks for the response. Yes I'm doing embedded so this is fine for
me. One other question, I have noticed that once I cancel my
PreparedStatement, it does not seem to work again. I couldn't find a
way to clear it, so I guess I have to re-instantiate it?
Also, how promptly should this cancel take effect? It seemed to be
fairly delayed, but there's still a chance my implementation wasn't
correct.
Hi,
You are right, a PreparedStatement could not be reused after cancel was called.
I have fixed this and added a test case. Thanks for reporting this!
Delayed cancel: if you use the database in embedded mode, it depends on thread
scheduling when the statement is cancelled (you need two threads). I also got
this problem. What I did is use Thread.yield in my test, like this:
CREATE ALIAS YIELD FOR "java.lang.Thread.yield";
SELECT YIELD() FROM ...
So for each row, Thread.yield() is called, letting other threads do some work.
Another solution would be to use SET THROTTLE (see docs).
Thomas
web page translation
web page translation
TestMultiThreadedKernel and integrate in unit tests; use also in-memory and so on
TestMultiThreadedKernel and integrate in unit tests; use also in-memory and so on
...
...
h2/src/test/org/h2/test/db/TestLinkedTable.java
浏览文件 @
5ff0818d
...
@@ -27,7 +27,7 @@ public class TestLinkedTable extends TestBase {
...
@@ -27,7 +27,7 @@ public class TestLinkedTable extends TestBase {
private
void
testLinkTwoTables
()
throws
Exception
{
private
void
testLinkTwoTables
()
throws
Exception
{
Class
.
forName
(
"org.h2.Driver"
);
Class
.
forName
(
"org.h2.Driver"
);
Connection
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:mem:one"
,
"
linkuser"
,
"linkpass
"
);
Connection
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:mem:one"
,
"
sa"
,
"sa
"
);
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"CREATE SCHEMA Y"
);
stat
.
execute
(
"CREATE SCHEMA Y"
);
stat
.
execute
(
"CREATE TABLE A( C INT)"
);
stat
.
execute
(
"CREATE TABLE A( C INT)"
);
...
@@ -36,8 +36,8 @@ public class TestLinkedTable extends TestBase {
...
@@ -36,8 +36,8 @@ public class TestLinkedTable extends TestBase {
stat
.
execute
(
"INSERT INTO Y.A VALUES(2)"
);
stat
.
execute
(
"INSERT INTO Y.A VALUES(2)"
);
Connection
conn2
=
DriverManager
.
getConnection
(
"jdbc:h2:mem:two"
);
Connection
conn2
=
DriverManager
.
getConnection
(
"jdbc:h2:mem:two"
);
Statement
stat2
=
conn2
.
createStatement
();
Statement
stat2
=
conn2
.
createStatement
();
stat2
.
execute
(
"CREATE LINKED TABLE one('org.h2.Driver', 'jdbc:h2:mem:one', '
linkuser', 'linkpass
', 'Y.A');"
);
stat2
.
execute
(
"CREATE LINKED TABLE one('org.h2.Driver', 'jdbc:h2:mem:one', '
sa', 'sa
', 'Y.A');"
);
stat2
.
execute
(
"CREATE LINKED TABLE two('org.h2.Driver', 'jdbc:h2:mem:one', '
linkuser', 'linkpass
', 'A');"
);
stat2
.
execute
(
"CREATE LINKED TABLE two('org.h2.Driver', 'jdbc:h2:mem:one', '
sa', 'sa
', 'A');"
);
ResultSet
rs
=
stat2
.
executeQuery
(
"SELECT * FROM one"
);
ResultSet
rs
=
stat2
.
executeQuery
(
"SELECT * FROM one"
);
rs
.
next
();
rs
.
next
();
check
(
rs
.
getInt
(
1
),
2
);
check
(
rs
.
getInt
(
1
),
2
);
...
...
h2/src/test/org/h2/test/db/TestLob.java
浏览文件 @
5ff0818d
...
@@ -101,17 +101,21 @@ public class TestLob extends TestBase {
...
@@ -101,17 +101,21 @@ public class TestLob extends TestBase {
try
{
try
{
conn
.
createStatement
().
execute
(
"DELETE FROM TEST"
);
conn
.
createStatement
().
execute
(
"DELETE FROM TEST"
);
conn
.
commit
();
conn
.
commit
();
// DELETE does no
w fail in all systems (Linux), but in some
// DELETE does no
t fail in Linux, but in Windows
// error("Error expected");
// error("Error expected");
// but reading afterwards should fail
// but reading afterwards should fail
int
len
=
0
;
while
(
true
)
{
while
(
true
)
{
int
x
=
in
.
read
();
int
x
=
in
.
read
();
if
(
x
<
0
)
{
if
(
x
<
0
)
{
break
;
break
;
}
}
len
++;
}
}
in
.
close
();
in
.
close
();
error
(
"Error expected"
);
if
(
len
>
0
)
{
error
(
"Error expected; len="
+
len
);
}
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
checkNotGeneralException
(
e
);
checkNotGeneralException
(
e
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论