So, i have a application that uses spring-boot 1.4.0 and a Oracle database. I'm trying to define the number of connections of the pool in the application.properties, using these configs:
spring.datasource.driverClassName = oracle.jdbc.OracleDriver
spring.datasource.url = url
spring.datasource.username = username
spring.datasource.password = password
spring.datasource.maxActive= x
spring.datasource.initialSize= y
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1 from dual
And i'm using the query
select *from V$SESSION where username= 'username';
to check the database connections, but when i run the application it's always using 10 connections, despite what i define as the initialSize. I tried to check other stackoverflow answers and examples on GitHub and i don't know why it's not working, so i would appreciate if someone can help me. Thanks!
You can still configure it by increasing the max connections (the default is 10 for instance).
Spring Boot 1.4 does not bind the DataSource
in the spring.datasource
namespace anymore. Each supported connection pool implementations have a dedicated namespace for their respective keys. You are probably looking at older samples.
You first need to identify which connection pool you are using (if you're relying on the starter you should probably get the Tomcat JDBC pool, see spring.datasource.tomcat
). Use your IDE to get the list of keys you can use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With