Ungraceful shutdown of connection pools towards Oracle

1.1k Views Asked by At

My understanding of the ecosystem is limited so excuse my ignorance.

I have a really large Oracle database (19) with a lot of connections to it from multiple applications. We have put some limit of maximum amount of connections (sessions) to it and we can hit that limit quite easily.

We are using Java 17 + Spring Boot 2.6.1 & HikariCP (considering UCP) & JDBI3

When I ran my application before adding connection pools I have noticed that when I terminate my connection ungracefully (kill the application forcefully) the connection is kept alive on Oracles side for quite a while (30m+). How is this handled when shutting down an application with connection pools? I assume that the connection pool will be shut down by TCP timeouts instead of a TCP FIN/ACK and that it works differently since the application is killed before being able to shut down the connections, but does that mean that the connections on the Oracle side would stay alive like before?

TL;DR: Do I need to handle an ungraceful shutdown by shutting down the connection pool manually to avoid Oracle keeping dead connections alive?

Alternatively I would need to contact our Oracle team and somehow convince them of lowering this keep-alive value that they seem to have on their side.

1

There are 1 best solutions below

1
Saurabh Verma On

You may try using Universal Connection Pool (UCP), it has an inbuilt mechanism to gracefully close the connections on application/JVM shutdown.