# HG changeset patch
# User Sebastien Jodogne <s.jodogne@gmail.com>
# Date 1546774529 -3600
# Node ID a2134531473c8db1f6f2355ac3a69487b2e8d357
# Parent  a1c6238b26f833dab341ca379cf6eac20d4374ab
avoid warnings "An active PostgreSQL transaction was dismissed"

diff -r a1c6238b26f8 -r a2134531473c PostgreSQL/Plugins/PostgreSQLIndex.cpp
--- a/PostgreSQL/Plugins/PostgreSQLIndex.cpp	Sat Jan 05 15:51:25 2019 +0100
+++ b/PostgreSQL/Plugins/PostgreSQLIndex.cpp	Sun Jan 06 12:35:29 2019 +0100
@@ -164,6 +164,10 @@
                        << "PostgreSQL server, e.g. on Debian: sudo apt install postgresql-contrib";
         }
       }
+      else
+      {
+        t.Commit();
+      }
     }
 
     {
@@ -182,9 +186,9 @@
         db->Execute(query);
 
         SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_HasCreateInstance, 1);
+      }
 
-        t.Commit();
-      }
+      t.Commit();
     }
 
     {
@@ -203,9 +207,9 @@
         db->Execute(query);
 
         SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_GetTotalSizeIsFast, 1);
+      }
 
-        t.Commit();
-      }
+      t.Commit();
     }
 
     return db.release();