Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Application Server » WebLogic  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 JBuilderX+WebLogic8.1测试数据库连接,奇怪的问题
sapphire_xt





发贴: 2
积分: 0
于 2005-03-31 15:46 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
连接池和数据源均配置正确,在测试的时候出现奇怪的问题
我的测试程序中有如下代码:
finally{

try{
if (sttm != null) {

sttm.close();

}
if (conn != null) {
conn.close();
}
}
catch(SQLException sqlee){
sqlee.printStackTrace();
}
}
即在数据库操作之后确保连接被关闭,以前在别的程序中这么做时从来没有报过错,可是这次我发现在完成了正常的和数据库操作后,抛出一个异常,如下:
java.sql.SQLException: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:
[java.rmi.NoSuchObjectException: The object identified by: '305' could not be found. Either it was has not been exported or it has been collected by the distributed garbage collector.]
异常位置指向finally中的sttm,说该对象已经不存在,被导出或被GC清除了!
当我把以上语句屏蔽后,测试成功,也不再抛出异常了!
这是否意味着在通过Weblogic提供的连接池连接时,以上语句都不能用啊?不用考虑连接未关闭的情况吗?

帮帮忙啊各位,我实在想不明白,给点建议吧,3Q!
Rose



作者 Re:JBuilderX+WebLogic8.1测试数据库连接,奇怪的问题 [Re:sapphire_xt]
sapphire_xt





发贴: 2
积分: 0
于 2005-04-04 13:29 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
怎么没人帮忙解释一下啊?Sad



flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923