Problems with SQL Server Connections

Hi orthanc users!

We are using orthanc together with MS SQL and noticed during testing that orthanc has difficulties to re-establish the connection to MS SQL Server if the connection dropped during operation.

It can be easily reproduced with the sample from here https://bitbucket.org/osimis/orthanc-setup-samples/src/master/docker/mssql/

With following steps:

start orthanc-setup-samples/mssql

docker-compose up -d

all ok

curl http://localhost:8042/statistics

let the connection “drop”, restart mssql

docker-compose restart new-index

http status 500, “Error with the database engine”

curl http://localhost:8042/statistics

let orthanc “recover”

docker-compose restart orthanc-new-mssql

all ok again

curl http://localhost:8042/statistics

We are running this in a k8s cluster. For the time being we added a liveness check to ultimately restart orthanc when there is a problem with the sql connection.

Do you have other options/ideas to better fix the problem?

A comment from Stephen D. Scotti made me curios, so I tested the same with MySQL and PosgreSQL. There the problem doesn’t exist, orthanc just works fine when the database is back!

So it seems to be specific for MS SQL Connections