Is there any way to have the JBoss connection pool reconnect to Oracle when connections go bad?(当连接变坏时,有没有办法让 JBoss 连接池重新连接到 Oracle?)
问题描述
我们的 JBoss 和 Oracle 位于不同的服务器上.连接似乎已断开并导致 JBoss 出现问题.如果在我们首先找出连接断开的原因时连接不好,我如何让 JBoss 重新连接到 Oracle?
We have our JBoss and Oracle on separate servers. The connections seem to be dropped and is causing issues with JBoss. How can I have the JBoss reconnect to Oracle if the connection is bad while we figure out why the connections are being dropped in the first place?
推荐答案
池上通常有一个配置选项,可以在借用时执行验证查询.如果验证查询成功执行,池将返回该连接.如果查询没有成功执行,池将创建一个新连接.
There is usually a configuration option on the pool to enable a validation query to be executed on borrow. If the validation query executes successfully, the pool will return that connection. If the query does not execute successfully, the pool will create a new connection.
JBoss Wiki 记录了池的各种属性.
The JBoss Wiki documents the various attributes of the pool.
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
似乎应该可以解决问题.
Seems like it should do the trick.
这篇关于当连接变坏时,有没有办法让 JBoss 连接池重新连接到 Oracle?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:当连接变坏时,有没有办法让 JBoss 连接池重新连接到 Oracle?
基础教程推荐
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 在多列上分布任意行 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
