CodexBloom - Programming Q&A Platform

OCI Database Connection Pooling Issues in Spring Boot Application

👀 Views: 59 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-23
spring-boot hikaricp oci Java

I'm working on a project and hit a roadblock. I'm working with an scenario with database connection pooling in my Spring Boot application when connecting to an Oracle Cloud Infrastructure (OCI) Autonomous Database. Despite configuring HikariCP as the connection pool with the recommended settings, I consistently receive a `java.sql.SQLException: Connection is not available, request timed out after 30 seconds`. I've set up the datasource properties in `application.properties` as follows: ```properties spring.datasource.url=jdbc:oracle:thin:@//<your-db-endpoint>:1522/<your-service-name> spring.datasource.username=<your-username> spring.datasource.password=<your-password> spring.datasource.driver-class-name=oracle.jdbc.OracleDriver spring.datasource.hikari.maximum-pool-size=10 spring.datasource.hikari.connection-timeout=30000 ``` The application runs fine with a direct connection but struggles when under load. I've also verified that the database allows for multiple concurrent connections and that the credentials are correct. I tried increasing the `maximum-pool-size` and `connection-timeout`, but it didn't help. Additionally, I monitored the connection usage in the OCI console, and it seems that the connections are being exhausted quickly under moderate traffic. Is there a specific configuration or best practice for managing connection pools with OCI that I might be missing? Any insights on how to diagnose or fix this scenario would be greatly appreciated!