Where are uploaded files stored and indexed ?

When I import instances into Orthanc from DICOM modality or another Orthanc peer, I can see the created objects (patient, study, series and instance) in index DB Resources table, and files (DICOM and DICOM as JSON) in AttachedFiles table.

When I upload a DICOM file using Orthanc explorer, the objects are created and the images can be viewed in explorer, I can find the new files in storage… but no entries are created in DB.

How is the uploaded DICOM indexed and how can explorer find it ?

Looks like you are re-importing DICOM files that were already stored by Orthanc.

No matter how the files are received by Orthanc (either through the DICOM protocol or through the REST API), they are stored the same way.

Hum … this is really strange :

After restarting Orthanc, I can no more read the db from command line. I get “Error: database is locked” !
Before restart, Orthanc worked fine and I could read the db, but updates were not visible.
It was like if Orthanc where working with a copy of the db, while I watched the original static file… is there a sort of memory cache with sqlite ?

My Orthanc is hosted on a cloud instance, with the db stored on a mounted virtual drive. What happens if the drive is temporarily disconnected then reconnected ? Does Orthanc keep the connexion to the database or automaticaly reopens a new one ?

Thanks for help

You must never, never access the SQLite database from another process while Orthanc is running.

Such simultaneous accesses can result in unpredictable results and in corruptions, because the accesses are not synchronized. The SQLite database is for private use only, and Orthanc assumes that it is at any time the only process that accesses the SQLite database.

If you wish 2 separate process to simultaneously access the Orthanc DB, you need to switch to PostgreSQL:
http://www.orthanc-server.com/static.php?page=postgresql

It was only for debug purpose, and in read mode ?

I will use the PostgreSQL plugin for production :wink: