Mercurial > hg > orthanc-databases
comparison PostgreSQL/Plugins/PostgreSQLIndex.cpp @ 77:a2134531473c db-changes
avoid warnings "An active PostgreSQL transaction was dismissed"
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sun, 06 Jan 2019 12:35:29 +0100 |
parents | a4e440e65c68 |
children | 2ee166f77501 |
comparison
equal
deleted
inserted
replaced
76:a1c6238b26f8 | 77:a2134531473c |
---|---|
162 << "not support trigram matching"; | 162 << "not support trigram matching"; |
163 LOG(WARNING) << "-> Consider installing the \"pg_trgm\" extension on the " | 163 LOG(WARNING) << "-> Consider installing the \"pg_trgm\" extension on the " |
164 << "PostgreSQL server, e.g. on Debian: sudo apt install postgresql-contrib"; | 164 << "PostgreSQL server, e.g. on Debian: sudo apt install postgresql-contrib"; |
165 } | 165 } |
166 } | 166 } |
167 else | |
168 { | |
169 t.Commit(); | |
170 } | |
167 } | 171 } |
168 | 172 |
169 { | 173 { |
170 PostgreSQLTransaction t(*db); | 174 PostgreSQLTransaction t(*db); |
171 | 175 |
180 Orthanc::EmbeddedResources::GetFileResource | 184 Orthanc::EmbeddedResources::GetFileResource |
181 (query, Orthanc::EmbeddedResources::POSTGRESQL_CREATE_INSTANCE); | 185 (query, Orthanc::EmbeddedResources::POSTGRESQL_CREATE_INSTANCE); |
182 db->Execute(query); | 186 db->Execute(query); |
183 | 187 |
184 SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_HasCreateInstance, 1); | 188 SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_HasCreateInstance, 1); |
185 | 189 } |
186 t.Commit(); | 190 |
187 } | 191 t.Commit(); |
188 } | 192 } |
189 | 193 |
190 { | 194 { |
191 PostgreSQLTransaction t(*db); | 195 PostgreSQLTransaction t(*db); |
192 | 196 |
201 Orthanc::EmbeddedResources::GetFileResource | 205 Orthanc::EmbeddedResources::GetFileResource |
202 (query, Orthanc::EmbeddedResources::POSTGRESQL_FAST_TOTAL_SIZE); | 206 (query, Orthanc::EmbeddedResources::POSTGRESQL_FAST_TOTAL_SIZE); |
203 db->Execute(query); | 207 db->Execute(query); |
204 | 208 |
205 SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_GetTotalSizeIsFast, 1); | 209 SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_GetTotalSizeIsFast, 1); |
206 | 210 } |
207 t.Commit(); | 211 |
208 } | 212 t.Commit(); |
209 } | 213 } |
210 | 214 |
211 return db.release(); | 215 return db.release(); |
212 } | 216 } |
213 | 217 |