Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
36ed8325
提交
36ed8325
authored
15 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
If a pooled connection was not closed but garbage collected, a NullPointerException could occur.
上级
b6d235be
master
noel-pr1
plus33-master
pr/267
stumc-Issue#576
version-1.1.x
version-1.4.198
version-1.4.197
version-1.4.196
version-1.4.195
version-1.4.194
version-1.4.193
version-1.4.192
version-1.4.191
version-1.4.190
version-1.4.188
version-1.4.187
version-1.4.186
version-1.4.185
version-1.4.184
version-1.4.183
version-1.4.182
version-1.4.181
version-1.4.178
version-1.4.177
version-1.3
version-1.2
version-1.1
version-1.0
无相关合并请求
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
39 行增加
和
4 行删除
+39
-4
changelog.html
h2/src/docsrc/html/changelog.html
+2
-1
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+8
-2
JdbcXAConnection.java
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
+19
-0
TraceObject.java
h2/src/main/org/h2/message/TraceObject.java
+10
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
36ed8325
...
...
@@ -18,7 +18,8 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Fulltext search: a NullPointerException was thrown when updating a value that
<ul><li>
If a pooled connection was not closed but garbage collected, a NullPointerException could occur.
</li><li>
Fulltext search: a NullPointerException was thrown when updating a value that
was NULL previously.
</li><li>
The Recover tool did not work with .data.db files of the wrong size.
</li><li>
Triggers: if there was an exception when initializing a trigger, this exception could be hidden,
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/jdbc/JdbcConnection.java
浏览文件 @
36ed8325
...
...
@@ -59,6 +59,12 @@ import java.sql.SQLClientInfoException;
* </p>
*/
public
class
JdbcConnection
extends
TraceObject
implements
Connection
{
/**
* The stack trace of when the connection was created.
*/
protected
Exception
openStackTrace
;
private
String
url
;
private
String
user
;
...
...
@@ -71,7 +77,6 @@ public class JdbcConnection extends TraceObject implements Connection {
private
CommandInterface
getReadOnly
,
getGeneratedKeys
;
private
CommandInterface
setLockMode
,
getLockMode
;
private
CommandInterface
setQueryTimeout
,
getQueryTimeout
;
private
Exception
openStackTrace
;
//## Java 1.4 begin ##
private
int
savepointId
;
...
...
@@ -285,6 +290,7 @@ public class JdbcConnection extends TraceObject implements Connection {
public
synchronized
void
close
()
throws
SQLException
{
try
{
debugCodeCall
(
"close"
);
openStackTrace
=
null
;
if
(
executingStatement
!=
null
)
{
executingStatement
.
cancel
();
}
...
...
@@ -1320,7 +1326,7 @@ public class JdbcConnection extends TraceObject implements Connection {
if
(
isInternal
)
{
return
;
}
if
(
session
!=
null
)
{
if
(
session
!=
null
&&
openStackTrace
!=
null
)
{
trace
.
error
(
"Connection not closed"
,
openStackTrace
);
try
{
close
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
浏览文件 @
36ed8325
...
...
@@ -20,6 +20,7 @@ import javax.transaction.xa.XAException;
import
javax.transaction.xa.XAResource
;
import
javax.transaction.xa.Xid
;
import
org.h2.constant.ErrorCode
;
import
org.h2.constant.SysProperties
;
import
org.h2.jdbc.JdbcConnection
;
import
org.h2.util.ByteUtils
;
import
org.h2.util.JdbcUtils
;
...
...
@@ -28,6 +29,7 @@ import org.h2.util.StringUtils;
//## Java 1.4 end ##
import
org.h2.message.Message
;
import
org.h2.message.Trace
;
import
org.h2.message.TraceObject
;
/*## Java 1.6 begin ##
...
...
@@ -94,6 +96,7 @@ implements XAConnection, XAResource
public
void
close
()
throws
SQLException
{
debugCodeCall
(
"close"
);
if
(
handleConn
!=
null
)
{
listeners
.
clear
();
handleConn
.
close
();
}
if
(
physicalConn
!=
null
)
{
...
...
@@ -479,6 +482,7 @@ implements XAConnection, XAResource
public
PooledJdbcConnection
(
JdbcConnection
conn
)
{
super
(
conn
);
openStackTrace
=
new
Exception
(
"Stack Trace"
);
}
public
synchronized
void
close
()
throws
SQLException
{
...
...
@@ -501,6 +505,21 @@ implements XAConnection, XAResource
super
.
checkClosed
(
write
);
}
protected
void
finalize
()
{
if
(!
SysProperties
.
runFinalize
)
{
return
;
}
Trace
trace
=
getTrace
();
try
{
if
(!
isClosed
())
{
trace
.
error
(
"Pooled connection not closed"
,
openStackTrace
);
JdbcXAConnection
.
this
.
close
();
}
}
catch
(
SQLException
e
)
{
trace
.
debug
(
"finalize"
,
e
);
}
}
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/message/TraceObject.java
浏览文件 @
36ed8325
...
...
@@ -131,7 +131,7 @@ public class TraceObject {
}
/**
* Update the trace.
* Update the trace
object
.
*
* @param trace the trace object
*/
...
...
@@ -139,6 +139,15 @@ public class TraceObject {
this
.
trace
=
trace
;
}
/**
* Get the trace object.
*
* @return the trace object
*/
protected
Trace
getTrace
()
{
return
trace
;
}
/**
* INTERNAL
*/
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论