comparison PostgreSQL/Plugins/PostgreSQLIndex.cpp @ 216:fbb52129158a

TransactionType given to PostgreSQLTransaction constructor
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 Mar 2021 17:47:56 +0100
parents 13a3863df7fa
children 73cc85f3d9c1
comparison
equal deleted inserted replaced
215:b40b30075c51 216:fbb52129158a
79 { 79 {
80 db->ClearAll(); 80 db->ClearAll();
81 } 81 }
82 82
83 { 83 {
84 PostgreSQLTransaction t(*db); 84 PostgreSQLTransaction t(*db, TransactionType_ReadWrite);
85 85
86 if (!db->DoesTableExist("Resources")) 86 if (!db->DoesTableExist("Resources"))
87 { 87 {
88 std::string query; 88 std::string query;
89 89
125 125
126 t.Commit(); 126 t.Commit();
127 } 127 }
128 128
129 { 129 {
130 PostgreSQLTransaction t(*db); 130 PostgreSQLTransaction t(*db, TransactionType_ReadWrite);
131 131
132 int hasTrigram = 0; 132 int hasTrigram = 0;
133 if (!LookupGlobalIntegerProperty(hasTrigram, *db, t, 133 if (!LookupGlobalIntegerProperty(hasTrigram, *db, t,
134 Orthanc::GlobalProperty_HasTrigramIndex) || 134 Orthanc::GlobalProperty_HasTrigramIndex) ||
135 hasTrigram != 1) 135 hasTrigram != 1)
172 t.Commit(); 172 t.Commit();
173 } 173 }
174 } 174 }
175 175
176 { 176 {
177 PostgreSQLTransaction t(*db); 177 PostgreSQLTransaction t(*db, TransactionType_ReadWrite);
178 178
179 int property = 0; 179 int property = 0;
180 if (!LookupGlobalIntegerProperty(property, *db, t, 180 if (!LookupGlobalIntegerProperty(property, *db, t,
181 Orthanc::GlobalProperty_HasCreateInstance) || 181 Orthanc::GlobalProperty_HasCreateInstance) ||
182 property != 2) 182 property != 2)