cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP Java - SAP Hana Cloud Connection Pool

DC
Explorer
0 Kudos

Hi Team,

Just wanted to clarify the default settings connection pool for CAP JAVA using SAP Cloud Hana DB.

I understand the following. Please correct me if i am wrong

  1. Uses Hikari Connection Pool.
  2. Defaults to 10??

We would also like to know how you change this default. I found this in a blog. This is implemented in the application.yaml

spring:
config.activate.on-profile: cloud
datasource:
    hikari: 
       maximum-pool-size: 20 

But in the CAPIRE documentation the example is this

cds:<br>  dataSource:<br>    my-service-instance:<br>      hikari:<br>        maximum-pool-size: 20

Which on is the correct configuration??

Also the dataSource in the documentation has "S" in uppercase, not sure if this has any effect.

what value to we put in the "my-service-instance"???

Also, how do we check the changes have been applied??? is there any way we can see this??

Appreciate your help with this.

Cheers

D

Accepted Solutions (1)

Accepted Solutions (1)

Harish_Vatsa
Active Contributor

Dear diri,

Yes. CAP for Java uses the Hikari Connection Pool by default and the default maximum pool size is 10.

Both the examples you provided seem to be correct. The first one uses a standard Spring Boot YAML configuration structure, and the second one uses a configuration structure specific to CAP in the CDS section.

Either one can be used based on your preference.

Uppercase "S" in dataSource should not have any effect, as YAML is case-insensitive for key names

The my-service-instance in the configuration corresponds to the name of the database service instance you've defined in your cloud environment. It's typically the name of the bound HANA database service.

--

Regards,

H.V.

marcbecker
Contributor

Please note, that the spring.datasource section must be used only if you explicitly configure your HANA connections in Spring. If you are using CAPs auto-configuration based on service bindings you need to use cds.dataSource.<my-service-binding-name>...

You can check the defaults by increasing the log level for Hikari, which will print the full effective configuration at pool initialization time. Set logger "com.zaxxer.hikari" to "DEBUG"

Answers (0)