The connection breaks after the data source indefinite period (workaround: Set up since the connection is closed and reconnect automatically.) The question is described below):
The original configuration file of the data source is as follows: (Note: 2 rows of Red line conflict)
The modified data source configuration is as follows: (resolve the problem of indefinite time database connection interruption) (Note:Verify the (partial) effect of the code: when the database connection is disconnected, reconnect automatically。 ) <validation> & nbsp <valid-connection-checker class-name= Org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker "/> <check-valid-connection-sql>select 1 from dual</ check-valid-connection-sql> //<V alidate-on-match>false</validate-on-match> <background-validation>true</background-validation> <background-validation-millis>200000</ background-validation-millis> &NBSP; <use-fast-fail>false</use-fast-fail> &N Bsp <stale-connection-checker class-name= " Org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker "/> <exception-sorter class-name= " Org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter "/> & nbsp </validation>
(Supplemental Knowledge) configuration of Wildfly server configuration files in engineeringDual Physical machine data source(Configuration Code): <connection-url>jdbc:oracle:thin:@ (description= (address_list=) (address= (protocol=tcp) (HOST= 10.100.24.30) (port=1521)) (Address= (PROTOCOL=TCP) (host=10.100.24.31) (port=1521)) (Load_balance=yes) (Failover=on) ) (Connect_data= (SERVICE_NAME=ORCL)) </connection-url> The configuration of wildfly server configuration file in the projecta physical machine data source(Configuration Code): < Connection-url > JDBC:ORACLE:THIN:@192.168.2.231:1521:ORCL </connection-url > (Note: When deploying a project, the database is deployed on multiple physical machines to prevent a database physical machine from hanging the impact project, when the database is deployed on multiple physical machines, you can create a virtual machine database to associate multiple physical machine databases so that only one IP connection is required in the server's data source connection configuration file.the entire data source configuration code is as follows (Dual Physical machine configuration): <datasources> & nbsp <datasource jta= "true" Jndi-name= "Java:jboss/datasources/oracleds_uam" pool-name= "Oracleds_uam" enabled= "true" Use-java-context= "true" use-ccm= "true" > <conne ction-url>jdbc:oracle:thin:@ (description= address_list= (address= (protocol=tcp) (HOST=10.100.24.30) (PORT=1521 ) (Address= (PROTOCOL=TCP) (host=10.100.24.31) (port=1521)) (Load_balance=yes) (Failover=on)) (Connect_data= (SERVICE _NAME=ORCL)) </connection-url> <DRIVER-CLA ss>oracle.jdbc.driver.oracledriver</driver-class> <driver>oracle</driver> &L t;pool> &NBSP; <min-pool-size>10</min-pool-size> &NBSP ; <max-pool-size>100</max-pool-size> &NBS P <prefill>true</prefill> &N Bsp <use-strict-min>false</use-strict-min> <flush-strategy>failingconnectiononly</flush-strategy > </pool> &NBSP ; <security> <user-name>sdsy</user-name> &NBSP ; <password>sdsy1qaz@wsx.</password> </ security> <validation> & nbsp <valid-connection-checker class-name= Org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker "/> <check-valid-connection-sql>select 1 from dual</ check-valid-connection-sql> <BAC kground-validation>true</background-validation> <background-validation-millis>200000</background-validation-millis> &NBSP <use-fast-fail>false</use-fast-fail> &N Bsp <stale-connection-checker Class-name= " Org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker "/> <exception-sorter class-name= " Org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter "/> & nbsp </validation> </datasource>   ; <drivers> &N Bsp <driver name= "Oracle" module= "Com.oracle" > &NB Sp <xa-datasource-class>oracle.jdbc.xa.client.oraclexadatasource</xa-datasource-class >   </driver> & nbsp </drivers> </datasources>