当数据库和 JBoss 断开连接时,任何版本的 JBoss 是否支持自动重新连接数据库?我尝试了以下配置
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<datasources>
<local-tx-datasource>
<jndi-name>sampleDS</jndi-name>
<min-pool-size>1</min-pool-size>
<max-pool-size>5</max-pool-size>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<connection-url>jdbc:oracle:thin:@<ip>:<databaseport>:<sip></connection-url>
<user-name>username</user-name>
<password>password</password>
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<check-valid-connection-sql>SELECT 1 FROM DUAL</check-valid-connection-sql>
<failOverReadOnly>false</failOverReadOnly>
<autoReconnect>true</autoReconnect>
<maxReconnects>50</maxReconnects>
<initialTimeout>15</initialTimeout>
</local-tx-datasource>