当连接变坏时,有没有办法让 JBoss 连接池重新连接到 Oracle?

Is there any way to have the JBoss connection pool reconnect to Oracle when connections go bad?(当连接变坏时,有没有办法让 JBoss 连接池重新连接到 Oracle?)
本文介绍了当连接变坏时,有没有办法让 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

SQL to Generate Periodic Snapshots from Transactions Table(用于从事务表生成定期快照的SQL)
MyBatis support for multiple databases(MyBatis支持多个数据库)
Oracle 12c SQL: Missing column Headers in result(Oracle 12c SQL:结果中缺少列标题)
SQL query to find the number of customers who shopped for 3 consecutive days in month of January 2020(查询2020年1月连续购物3天的客户数量)
How to get top 10 data weekly (This week, Previous week, Last month, 2 months ago, 3 month ago)(如何每周获取前十大数据(本周、前一周、上个月、2个月前、3个月前))
Select the latest record for an Id per day - Oracle pl sql(选择每天ID的最新记录-Oracle pl SQL)