diff PostgreSQL/Plugins/PostgreSQLDefinitions.h @ 418:a7f0f27fe33c pg-transactions

wip: advisory lock around CreateInstance: not ok see WO-139
author Alain Mazy <am@osimis.io>
date Tue, 27 Jun 2023 15:17:39 +0200
parents 3d6886f3e5b3
children f0976163dbe1
line wrap: on
line diff
--- a/PostgreSQL/Plugins/PostgreSQLDefinitions.h	Fri Jun 23 14:26:58 2023 +0200
+++ b/PostgreSQL/Plugins/PostgreSQLDefinitions.h	Tue Jun 27 15:17:39 2023 +0200
@@ -48,3 +48,10 @@
  * https://groups.google.com/d/msg/orthanc-users/yV3LSTh_TjI/h3PRApJFBAAJ
  **/
 static const int32_t POSTGRESQL_LOCK_DATABASE_SETUP = 44;
+
+/**
+ * Transient advisory lock to protect the instance creation,
+ * because it is not 100% resilient to concurrency in, e.g, READ COMIITED 
+ * transaction isolation level.
+ **/
+static const int32_t POSTGRESQL_LOCK_CREATE_INSTANCE = 45;