当连接变坏时,有什么方法可以使JBoss连接池重新连接到Oracle? [英] Is there any way to have the JBoss connection pool reconnect to Oracle when connections go bad?

查看:390
本文介绍了当连接变坏时,有什么方法可以使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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆