Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e3249f2c
提交
e3249f2c
authored
16 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Each session threw an invisible exception when garbage collected.
上级
b51cf46d
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
53 行增加
和
23 行删除
+53
-23
changelog.html
h2/src/docsrc/html/changelog.html
+3
-1
Session.java
h2/src/main/org/h2/engine/Session.java
+3
-11
SessionFactory.java
h2/src/main/org/h2/engine/SessionFactory.java
+24
-0
SessionFactoryEmbedded.java
h2/src/main/org/h2/engine/SessionFactoryEmbedded.java
+20
-0
SessionInterface.java
h2/src/main/org/h2/engine/SessionInterface.java
+0
-8
SessionRemote.java
h2/src/main/org/h2/engine/SessionRemote.java
+3
-3
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
e3249f2c
...
...
@@ -18,7 +18,9 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
New meta data column INFORMATION_SCHEMA.TABLES.LAST_MODIFICATION to get
<ul><li>
Each session threw an invisible exception when garbage collected.
</li><li>
Foreign key constraints referring to a quoted column did not work.
</li><li>
New meta data column INFORMATION_SCHEMA.TABLES.LAST_MODIFICATION to get
the table modification counter.
</li><li>
Shell: line comments didn't work correctly.
</li><li>
H2 Console: Columns are now listed for up to 500 tables instead of 100.
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Session.java
浏览文件 @
e3249f2c
...
...
@@ -42,9 +42,9 @@ import org.h2.value.ValueLong;
import
org.h2.value.ValueNull
;
/**
* A session represents a
database connection. When using the server mode, this
*
object resides on the server side and communicates with a RemoteSession on
* the client side.
* A session represents a
n embedded database connection. When using the server
*
mode, this object resides on the server side and communicates with a
*
SessionRemote object on
the client side.
*/
public
class
Session
implements
SessionInterface
{
...
...
@@ -92,10 +92,6 @@ public class Session implements SessionInterface {
private
Table
waitForLock
;
private
int
modificationId
;
public
Session
()
{
// nothing to do
}
Session
(
Database
database
,
User
user
,
int
id
)
{
this
.
database
=
database
;
this
.
undoLog
=
new
UndoLog
(
this
);
...
...
@@ -305,10 +301,6 @@ public class Session implements SessionInterface {
this
.
lockTimeout
=
lockTimeout
;
}
public
SessionInterface
createSession
(
ConnectionInfo
ci
)
throws
SQLException
{
return
Engine
.
getInstance
().
getSession
(
ci
);
}
public
CommandInterface
prepareCommand
(
String
sql
,
int
fetchSize
)
throws
SQLException
{
return
prepareLocal
(
sql
);
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/SessionFactory.java
0 → 100644
浏览文件 @
e3249f2c
/*
* Copyright 2004-2008 H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
engine
;
import
java.sql.SQLException
;
/**
* A class that implements this interface can create new database sessions.
*/
public
interface
SessionFactory
{
/**
* Create a new session.
*
* @param ci the connection parameters
* @return the new session
*/
SessionInterface
createSession
(
ConnectionInfo
ci
)
throws
SQLException
;
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/SessionFactoryEmbedded.java
0 → 100644
浏览文件 @
e3249f2c
/*
* Copyright 2004-2008 H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
engine
;
import
java.sql.SQLException
;
/**
* A factory for embedded database sessions.
*/
public
class
SessionFactoryEmbedded
implements
SessionFactory
{
public
SessionInterface
createSession
(
ConnectionInfo
ci
)
throws
SQLException
{
return
Engine
.
getInstance
().
getSession
(
ci
);
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/SessionInterface.java
浏览文件 @
e3249f2c
...
...
@@ -45,14 +45,6 @@ public interface SessionInterface {
*/
boolean
isClosed
();
/**
* Open a new session.
*
* @param ci the connection parameters
* @return the new session
*/
SessionInterface
createSession
(
ConnectionInfo
ci
)
throws
SQLException
;
/**
* Get the number of disk operations before power failure is simulated.
* This is used for testing. If not set, 0 is returned
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/SessionRemote.java
浏览文件 @
e3249f2c
...
...
@@ -41,7 +41,7 @@ import org.h2.value.ValueString;
* The client side part of a session when using the server mode. This object
* communicates with a Session on the server side.
*/
public
class
SessionRemote
implements
SessionInterface
,
DataHandler
{
public
class
SessionRemote
implements
SessionInterface
,
SessionFactory
,
DataHandler
{
public
static
final
int
SESSION_PREPARE
=
0
;
public
static
final
int
SESSION_CLOSE
=
1
;
...
...
@@ -244,11 +244,11 @@ public class SessionRemote implements SessionInterface, DataHandler {
backup
=
(
ConnectionInfo
)
ci
.
clone
();
connectionInfo
=
(
ConnectionInfo
)
ci
.
clone
();
}
Session
Interface
si
=
(
SessionInterface
)
ClassUtils
.
loadSystemClass
(
"org.h2.engine.Session
"
).
newInstance
();
Session
Factory
sf
=
(
SessionFactory
)
ClassUtils
.
loadSystemClass
(
"org.h2.engine.SessionFactoryEmbedded
"
).
newInstance
();
if
(
openNew
)
{
ci
.
setProperty
(
"OPEN_NEW"
,
"true"
);
}
return
s
i
.
createSession
(
ci
);
return
s
f
.
createSession
(
ci
);
}
catch
(
SQLException
e
)
{
int
errorCode
=
e
.
getErrorCode
();
if
(
errorCode
==
ErrorCode
.
DATABASE_ALREADY_OPEN_1
)
{
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论