Reputation: 211
From Github:
Any positive number is taken to be the number of milliseconds to attempt to acquire an initial connection; the application thread will be blocked during this period. Default: 1
I understand when using default value if connection is not obtained within 1 sec then error will be thrown .I am planning to set the value as 1000 ms as sometimes I am getting the error as
"hikaripool$poolinitializationexception"
when starting the spring boot Java 8 app. Is this the correct approach?
Upvotes: 4
Views: 5804
Reputation: 58772
Not exactly it wait for connection connectTimeout
+ initializationFailTimeout
, from github:
This timeout is applied after the
connectionTimeout
period
Which is by default half a minute
Default: 30000 (30 seconds)
You can enter -1
value to allow pool to start without failing
A value less than zero will bypass any initial connection attempt, and the pool will start immediately while trying to obtain connections in the background
Upvotes: 4