comparison OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp @ 5237:cd2258ca7894 db-protobuf

log about missing support for labels
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Apr 2023 09:07:47 +0200
parents 7363b6e7edf5
children 367e8af46cfd
comparison
equal deleted inserted replaced
5236:5e0db9eac1f8 5237:cd2258ca7894
605 * global mutex that was protecting the database. 605 * global mutex that was protecting the database.
606 **/ 606 **/
607 607
608 Transaction transaction(db_, *factory_, TransactionType_ReadOnly); // TODO - Only if not "TransactionType_Implicit" 608 Transaction transaction(db_, *factory_, TransactionType_ReadOnly); // TODO - Only if not "TransactionType_Implicit"
609 { 609 {
610 ReadOnlyTransaction t(transaction.GetDatabaseTransaction(), transaction.GetContext()); 610 ReadOnlyTransaction t(transaction.GetDatabaseTransaction(), transaction.GetContext(), db_.HasLabelsSupport());
611 readOperations->Apply(t); 611 readOperations->Apply(t);
612 } 612 }
613 transaction.Commit(); 613 transaction.Commit();
614 } 614 }
615 else 615 else
616 { 616 {
617 assert(writeOperations != NULL); 617 assert(writeOperations != NULL);
618 618
619 Transaction transaction(db_, *factory_, TransactionType_ReadWrite); 619 Transaction transaction(db_, *factory_, TransactionType_ReadWrite);
620 { 620 {
621 ReadWriteTransaction t(transaction.GetDatabaseTransaction(), transaction.GetContext()); 621 ReadWriteTransaction t(transaction.GetDatabaseTransaction(), transaction.GetContext(), db_.HasLabelsSupport());
622 writeOperations->Apply(t); 622 writeOperations->Apply(t);
623 } 623 }
624 transaction.Commit(); 624 transaction.Commit();
625 } 625 }
626 626
936 currentInternalId = currentParentId; 936 currentInternalId = currentParentId;
937 } 937 }
938 } 938 }
939 } 939 }
940 940
941 if (expandFlags & ExpandResourceFlags_IncludeLabels) 941 if ((expandFlags & ExpandResourceFlags_IncludeLabels) &&
942 transaction.HasLabelsSupport())
942 { 943 {
943 transaction.ListLabels(target.labels_, internalId); 944 transaction.ListLabels(target.labels_, internalId);
944 } 945 }
945 946
946 std::string tmp; 947 std::string tmp;