Reputation: 71
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!
Upvotes: 7
Views: 12379
Reputation: 33091
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.
Upvotes: 7