简体   繁体   中英

Spring boot application holdings old connections to database even after restart of oracle database also returning zero records

After restart of the oracle database the spring boot application holds the old closed connections to the oracle database instead of closing them and open new connections to the oracle database like the other spring boot applications. Is there any property missing. please find the below sample code.

application-DEV.properties

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.Oracle12cDialect
spring.flyway.enabled=false

spring.datasource.url=jdbc:oracle:thin:@sJv0oxaef33.qwe.skynet.net:39001/BXG235_sJv0oxaef33.qwe.skynet.net
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
spring.datasource.username=Vnet_C_DEV
spring.datasource.password=0XAAYJ,BfA**@8465;

If you don't have a simple single-instance Oracle database but an environment with Oracle Restart or even a Cluster, you can configure FCF (Fast Connect Failover based on FAN/ONS). FAN/ONS will inform the Connection Pool to close all dead connections (without having to wait for an error to close them):

https://docs.spring.io/spring-data/jdbc/old-docs/2.0.0.BUILD-SNAPSHOT/reference/html/orcl.failover.html

https://www.oracle.com/technetwork/database/options/clustering/applicationcontinuity/learnmore/fastapplicationnotification12c-2538999.pdf

https://www.oracle.com/technetwork/database/options/clustering/ac-with-oracle-database-5303807.pdf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM