1.spring.datasource.hikari.connectionTimeout
Meaning:
How long an application waits to get a DB connection from the pool before throwing an exception.
Ex:
spring.datasource.hikari.connectionTimeout=30000
= Wait for 30 seconds
Real-time Scenario
Suppose:
All DB connections are busy
New request comes
Application asks pool for connection
If no connection becomes available within 30 seconds:
Plain text
SQLTransientConnectionException:
Connection is not available, request timed out
2.spring.datasource.hikari.idleTimeout
Meaning:
How long an unused/idle connection stays in pool before being removed.
Unit
Milliseconds
Example
Properties
spring.datasource.hikari.idleTimeout=600000
= 10 minutes
Real-time Understanding
Suppose:
Your app created 20 DB connections
Only 5 are being used
Remaining 15 are idle
After idleTimeout duration:
Extra unused connections may be closed
Helps save DB resources
Important Point
This works mainly when:
Plain text
minimumIdle < maximumPoolSize
Otherwise pool keeps all connections alive.






























