SQLite: Cannot run a cached statement

706 views Asked by At

I am using Orthanc inside Docker volume

volumes: 
  - /mnt/win_share/test:/var/lib/orthanc/db/

Orthanc.js file path for sqlite

  "StorageDirectory": "/var/lib/orthanc/db",

i am trying to copy Orthanc path intialized in Docker to the drive mounted on my Ubuntu system and whenever I try running the commands i get the following errors

Errors:

  1. SQLite error code 5
  2. Cannot serialize the jobs engine: SQLite: Cannot run a cached statement
  3. StatelessDatabaseOperations:3260] EXCEPTION [SQLite: Cannot run a cached statement - ]
1

There are 1 answers

0
brigide On

I had a similar problem while trying to run two Orthanc instances poiting to the same SQLite database.

Basically, this SQLite error code 5 means that SQLite is busy. The only solution I could find to this was to use another database (such as PostgreSQL).

Orthanc configuration file:

  "Name": "Orthanc inside Docker",
  "PostgreSQL" : {
    "EnableIndex" : true,
    "EnableStorage" : true,
    "Lock" : false,
    "ConnectionUri" : "postgresql://username:password@host:port/database"
  },  
  "Plugins": [
    "/home/user/orthancdatabases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so",
    "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so"
  ],

This happens because there is a database storing DICOM and JSON files and another database storing the DICOM hierarchy and tags. The second one is accessed synchronously by Orthanc.

However, in the PostgreSQL plugin, the database for hierarchy and tags is isolated properly, allowing you to access the same database as many as you want.

Hope this helps!