Error when trying to connect multiple databases #934
-
|
Hello everyone here, first, id' like to thank the developers for this great and useful project ! Am I missing something in my conf ? Is it a bug ? First configuration tried (Powershell script on Windows): Log Second configuration tested - application.yml Powershell script java -jar ./db2rest-1.6.8.jar Log |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
|
For some reason in your environment the Hikari connection pool library that we use in code is defaulting to a pool size of 0 or -1 on your Windows system? weird, its actually 10 by default.
If you want to get lots of debug info on the whole configuration you can also pass
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your answer. I tried and have now this error: |
Beta Was this translation helpful? Give feedback.
-
|
I'm using the JDK 25, I don't know if it could be important as the requirement is 21+ |
Beta Was this translation helpful? Give feedback.
-
|
OK, I've reproduced the issue. For now, use this revised script and hack as you need. Auth is disabled for my testing, so you can add those back into this script (seriously awesome help for it came from Grok AI here after about 1 hour of troubleshooting and verifying our own sourcecode). db2rest_start.ps1 $json = @'
{
"logging": {
"level": {
"com.zaxxer.hikari": "TRACE",
"com.zaxxer.hikari.HikariConfig": "TRACE"
}
},
"app": {
"databases": [
{
"id": "db1",
"type": "MYSQL",
"url": "jdbc:mysql://127.0.0.1:3306/demov5?zeroDateTimeBehavior=CONVERT_TO_NULL",
"username": "fake_user",
"password": "fake_password",
"maxConnections": 10
}
]
}
}
'@
$env:SPRING_APPLICATION_JSON = $json
$env:ENABLE_AUTH = "false"
$env:SERVER_PORT = 6001
Write-Host "Starting db2rest with Hikari DEBUG logging..."
java -jar ./db2rest-1.6.8.jar@kdhrubo this is a bug in our code somewhere for multi database config. It's not setting HikariConfig like it does with non-multi database, and thus doesn't get the regular HikariConfig defaults (like maximumPoolSize=10 in Hikari source for builder). |
Beta Was this translation helpful? Give feedback.
OK, I've reproduced the issue.
It's basically quite simple. Your SPRING_APPLICATION_JSON doesn't include the
maxConnections: 10and actually it should not, it should be defaulted in our code somehow for even multi database config, but currently it's not. That's a bug.For now, use this revised script and hack as you need. Auth is disabled for my testing, so you can add those back into this script (seriously awesome help for it came from Grok AI here after about 1 hour of troubleshooting and verifying our own sourcecode).
I've enabled more logging in case you want to inspect more.
db2rest_start.ps1