Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
37c1e360
提交
37c1e360
authored
17 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
4685d322
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
40 行增加
和
4 行删除
+40
-4
history.html
h2/src/docsrc/html/history.html
+3
-3
DatabaseCloser.java
h2/src/main/org/h2/engine/DatabaseCloser.java
+5
-1
JdbcXAConnection.java
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
+3
-0
TestXA.java
h2/src/test/org/h2/test/jdbc/xa/TestXA.java
+29
-0
没有找到文件。
h2/src/docsrc/html/history.html
浏览文件 @
37c1e360
...
@@ -40,7 +40,8 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
...
@@ -40,7 +40,8 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>
Version 1.0 (Current)
</h3>
<h3>
Version 1.0 (Current)
</h3>
<h3>
Version 1.0.60 (2007-10-?)
</h3><ul>
<h3>
Version 1.0.60 (2007-10-?)
</h3><ul>
<li>
User defined aggregate functions are not supported.
<li>
JdbcXAConnection: starting a transaction before getting the connection didn't switch off autocommit.
</li><li>
User defined aggregate functions are not supported.
</li><li>
Server.shutdownTcpServer was blocked when first called with force=false and then force=true.
</li><li>
Server.shutdownTcpServer was blocked when first called with force=false and then force=true.
Now documentation is improved, and it is no longer blocked.
Now documentation is improved, and it is no longer blocked.
</li><li>
Stack traces did not include the SQL statement in all cases where they could have.
</li><li>
Stack traces did not include the SQL statement in all cases where they could have.
...
@@ -489,7 +490,6 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
...
@@ -489,7 +490,6 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
</li><li>
Read-only databases inside a jar (splitting large files to speed up random access)
</li><li>
Read-only databases inside a jar (splitting large files to speed up random access)
</li><li>
RECOVER=1 should automatically recover, =2 should run the recovery tool if required
</li><li>
RECOVER=1 should automatically recover, =2 should run the recovery tool if required
</li><li>
More tests with MULTI_THREADED=1
</li><li>
More tests with MULTI_THREADED=1
</li><li>
Improve performance for create table (if this is possible)
</li><li>
Test with Spatial DB in a box / JTS (http://docs.codehaus.org/display/GEOS/SpatialDBBox)
</li><li>
Test with Spatial DB in a box / JTS (http://docs.codehaus.org/display/GEOS/SpatialDBBox)
</li><li>
Document how to use H2 with PHP (generic database API)
</li><li>
Document how to use H2 with PHP (generic database API)
</li><li>
Optimization: result set caching (like MySQL)
</li><li>
Optimization: result set caching (like MySQL)
...
@@ -562,7 +562,6 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
...
@@ -562,7 +562,6 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
</li><li>
Implement missing JDBC API (CallableStatement,...)
</li><li>
Implement missing JDBC API (CallableStatement,...)
</li><li>
Sequence: add features [NO] MINVALUE, MAXVALUE, CACHE, CYCLE
</li><li>
Sequence: add features [NO] MINVALUE, MAXVALUE, CACHE, CYCLE
</li><li>
Compression of the cache
</li><li>
Compression of the cache
</li><li>
Run H2 Console inside servlet (pass-through servlet of fix the JSP / app)
</li><li>
Include SMPT (mail) server (at least client) (alert on cluster failure, low disk space,...)
</li><li>
Include SMPT (mail) server (at least client) (alert on cluster failure, low disk space,...)
</li><li>
Make the jar more modular
</li><li>
Make the jar more modular
</li><li>
Drop with restrict (currently cascade is the default)
</li><li>
Drop with restrict (currently cascade is the default)
...
@@ -802,6 +801,7 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
...
@@ -802,6 +801,7 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
</li><li>
Optimize SELECT MIN(ID), MAX(ID), COUNT(*) FROM TEST WHERE ID BETWEEN 100 AND 200
</li><li>
Optimize SELECT MIN(ID), MAX(ID), COUNT(*) FROM TEST WHERE ID BETWEEN 100 AND 200
</li><li>
Support Oracle functions: TRUNC, NVL2, TO_CHAR, TO_DATE, TO_NUMBER
</li><li>
Support Oracle functions: TRUNC, NVL2, TO_CHAR, TO_DATE, TO_NUMBER
</li><li>
Support setQueryTimeout (using System.currentTimeMillis in a loop; not using a thread)
</li><li>
Support setQueryTimeout (using System.currentTimeMillis in a loop; not using a thread)
</li><li>
Support large updates and deletes (currently all rows are loaded into memory)
</li></ul>
</li></ul>
<h3>
Not Planned
</h3>
<h3>
Not Planned
</h3>
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/DatabaseCloser.java
浏览文件 @
37c1e360
...
@@ -28,7 +28,11 @@ public class DatabaseCloser extends Thread {
...
@@ -28,7 +28,11 @@ public class DatabaseCloser extends Thread {
// and cause a memory leak if never started.
// and cause a memory leak if never started.
// Need to start it, otherwise it leaks memory in JDK 1.4 and below
// Need to start it, otherwise it leaks memory in JDK 1.4 and below
stopImmediately
=
true
;
stopImmediately
=
true
;
start
();
try
{
start
();
}
catch
(
Throwable
e
)
{
// ignore
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
浏览文件 @
37c1e360
...
@@ -88,6 +88,9 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -88,6 +88,9 @@ implements XAConnection, XAResource, JdbcConnectionListener
info
.
setProperty
(
"password"
,
password
);
info
.
setProperty
(
"password"
,
password
);
JdbcConnection
conn
=
new
JdbcConnection
(
url
,
info
);
JdbcConnection
conn
=
new
JdbcConnection
(
url
,
info
);
conn
.
setJdbcConnectionListener
(
this
);
conn
.
setJdbcConnectionListener
(
this
);
if
(
currentTransaction
!=
null
)
{
conn
.
setAutoCommit
(
false
);
}
return
conn
;
return
conn
;
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/jdbc/xa/TestXA.java
浏览文件 @
37c1e360
...
@@ -23,6 +23,7 @@ public class TestXA extends TestBase {
...
@@ -23,6 +23,7 @@ public class TestXA extends TestBase {
private
static
final
String
DB_URL2
=
"jdbc:h2:file:"
+
baseDir
+
"/"
+
DB_NAME2
;
private
static
final
String
DB_URL2
=
"jdbc:h2:file:"
+
baseDir
+
"/"
+
DB_NAME2
;
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testXAAutoCommit
();
deleteDb
(
baseDir
,
"xa"
);
deleteDb
(
baseDir
,
"xa"
);
testXA
(
true
);
testXA
(
true
);
deleteDb
(
baseDir
,
DB_NAME1
);
deleteDb
(
baseDir
,
DB_NAME1
);
...
@@ -30,6 +31,34 @@ public class TestXA extends TestBase {
...
@@ -30,6 +31,34 @@ public class TestXA extends TestBase {
testXA
(
false
);
testXA
(
false
);
}
}
public
static
class
MyXid
implements
Xid
{
private
byte
[]
branchQualifier
=
new
byte
[
1
];
private
byte
[]
globalTransactionId
=
new
byte
[
1
];
public
byte
[]
getBranchQualifier
()
{
return
branchQualifier
;
}
public
int
getFormatId
()
{
return
0
;
}
public
byte
[]
getGlobalTransactionId
()
{
return
globalTransactionId
;
}
}
private
void
testXAAutoCommit
()
throws
Exception
{
JdbcDataSource
ds
=
new
JdbcDataSource
();
ds
.
setURL
(
"jdbc:h2:mem:test"
);
ds
.
setUser
(
"sa"
);
ds
.
setPassword
(
""
);
XAConnection
xa
=
ds
.
getXAConnection
();
MyXid
xid
=
new
MyXid
();
xa
.
getXAResource
().
start
(
xid
,
XAResource
.
TMNOFLAGS
);
Connection
c
=
xa
.
getConnection
();
check
(!
c
.
getAutoCommit
());
c
.
close
();
}
private
void
testXA
(
boolean
useOneDatabase
)
{
private
void
testXA
(
boolean
useOneDatabase
)
{
XAConnection
xaConn1
=
null
;
XAConnection
xaConn1
=
null
;
XAConnection
xaConn2
=
null
;
XAConnection
xaConn2
=
null
;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论