seesion不及时释放导致的数据库连接问题

这几天正在开发的系统,出现了严重的数据库连接问题,时常因挂掉,


警告: SQL Error: 0, SQLState: null
2011-1-12 11:20:40 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: Listener refused the connection with the following error:
ORA-12518, TNS:listener could not hand off client connection
The Connection descriptor used by the client was:
192.168.1.167:1521:orcl

2011-1-12 11:20:40 org.hibernate.cfg.SettingsFactory buildSettings
警告: Could not obtain connection metadata
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12518, TNS:listener could not hand off client connection
The Connection descriptor used by the client was:
192.168.1.167:1521:orcl

排除了数据库本身的问题后,只能从自身找问题了。


<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>/message/*</url-pattern>
</filter-mapping>

问题就是配置只过滤了部分数据连接。导致还有大量的hibernate session没有及时关闭。

但有时候还是有问题,又从网上找了这么一段,参考:
[quote]
原因一般为:客户连接到监听器后,监听器把客户重定向到调度程序端口,由于操作系统问题,这些连接会被拒绝。
要解决这个问题,只需要在LISTENER.ORA的头部加入这一行DIRECT_HANDOFF_TTC_LISTENER = OFF即可。

在listener.ora文件加上一句 DIRECT_HANDOFF_TTC_LISTENER = OFF

然后重启监听服务

lsnrctl stop
lsnrctl start
[/quote]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值