Mercurial > hg > orthanc
comparison OrthancServer/ServerIndex.cpp @ 2717:d33659c28c6b jobs
fix missing transaction
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 12 Jul 2018 10:43:02 +0200 |
parents | d26dd081df97 |
children | 46061a91c88a |
comparison
equal
deleted
inserted
replaced
2715:73bc0c32547c | 2717:d33659c28c6b |
---|---|
1184 std::list<ServerIndexChange> changes; | 1184 std::list<ServerIndexChange> changes; |
1185 bool done; | 1185 bool done; |
1186 | 1186 |
1187 { | 1187 { |
1188 boost::mutex::scoped_lock lock(mutex_); | 1188 boost::mutex::scoped_lock lock(mutex_); |
1189 | |
1190 // Fix wrt. Orthanc <= 1.3.2: A transaction was missing, as | |
1191 // "GetLastChange()" involves calls to "GetPublicId()" | |
1192 Transaction transaction(*this); | |
1189 db_.GetChanges(changes, done, since, maxResults); | 1193 db_.GetChanges(changes, done, since, maxResults); |
1194 transaction.Commit(0); | |
1190 } | 1195 } |
1191 | 1196 |
1192 FormatLog(target, changes, "Changes", done, since); | 1197 FormatLog(target, changes, "Changes", done, since); |
1193 } | 1198 } |
1194 | 1199 |
1197 { | 1202 { |
1198 std::list<ServerIndexChange> changes; | 1203 std::list<ServerIndexChange> changes; |
1199 | 1204 |
1200 { | 1205 { |
1201 boost::mutex::scoped_lock lock(mutex_); | 1206 boost::mutex::scoped_lock lock(mutex_); |
1207 | |
1208 // Fix wrt. Orthanc <= 1.3.2: A transaction was missing, as | |
1209 // "GetLastChange()" involves calls to "GetPublicId()" | |
1210 Transaction transaction(*this); | |
1202 db_.GetLastChange(changes); | 1211 db_.GetLastChange(changes); |
1212 transaction.Commit(0); | |
1203 } | 1213 } |
1204 | 1214 |
1205 FormatLog(target, changes, "Changes", true, 0); | 1215 FormatLog(target, changes, "Changes", true, 0); |
1206 } | 1216 } |
1207 | 1217 |