I have the below doubts on the Hikari or any database pooling concept.
When does the connection pool gets created?
Suppose if I have mentionedspring.datasource.hikari.maximum-pool-size=50
Will it create 50 database instances?As by default, Spring scopes on classes in singleton, how 50 instances are created?
Connection poolinghelps reducing in creating database connections everytime a database call is encountered.Poolwould be nothing but set of connections (ideally active) (Like we havethread pool), when requested will return one active connection ( or create one for first database request) ,instancewould be a misfit word here !To answer first part of your question, it is initialized during application startup when that
spring.datasource.hikari...property is encountered.Below link explains this concept well
https://coderstea.in/post/best-practices/jdbc-connection-pooling-explained-with-hikaricp/