[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Packaging of a Web viewer of medical images



> This page mentions the need to --unlock the PG database under
> certain circumstances.

The locking of the database is just a feature to prevent two distinct instances of Orthanc from using the same database. Nothing prevents 2 instances of Orthanc from using the same PostgreSQL database, but this might result in surprising behaviors if the configurations of these instances are inconsistent (think for instance about the "MaximumStorageSize" option [1]).

Technically, "Locking" only means that a value is set in a table to say that some instance of Orthanc is using the DB. Similarly, "unlocking" means removing this value. In other word, this is not a locking at the PostgreSQL level. 

If you are certain that a single instance of Orthanc will use the DB at any time, you can use set the "Lock" option to "false" in the configuration file to disable this locking mechanism.


> May I ask whether Orthanc uses a persistent connection to
> PostgreSQL or temporary ones ?  In case it uses a persistent
> connection I am pretty sure we can come up with a scheme
> which does NOT require a manual unlock should Orthanc shut
> down out-of-order.

Each of the plugins creates 1 single PostgreSQL connection that is opened at the initialization of the plugin (during the startup of Orthanc), and that is closed at the finalization of the plugin (during the finalization of Orthanc). 

HTH,
Sébastien-


[1] https://code.google.com/p/orthanc/source/browse/Resources/Configuration.json


Reply to: