Where are uploaded files stored and indexed ?

419 views
Skip to first unread message

Marc Delpont

unread,
Aug 21, 2015, 7:13:05 AM8/21/15
to Orthanc Users
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 ?

Sébastien Jodogne

unread,
Aug 21, 2015, 7:17:35 AM8/21/15
to Orthanc Users
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.

Marc Delpont

unread,
Aug 21, 2015, 8:58:35 AM8/21/15
to Orthanc Users
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

Sébastien Jodogne

unread,
Aug 21, 2015, 9:08:06 AM8/21/15
to Orthanc Users
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:

Marc Delpont

unread,
Aug 21, 2015, 9:38:30 AM8/21/15
to Orthanc Users
It was only for debug purpose, and in read mode ?

I will use the PostgreSQL plugin for production ;)
Reply all
Reply to author
Forward
0 new messages