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 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- SQL 临时表问题 2022-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01