comparison OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp @ 4594:d494b4f1103e db-changes

removed the global database mutex from ServerIndex and StatelessDatabaseOperations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 16 Mar 2021 12:43:43 +0100
parents ff8170d17d90
children cc64385593ef
comparison
equal deleted inserted replaced
4593:60a860942c5e 4594:d494b4f1103e
603 603
604 for (;;) 604 for (;;)
605 { 605 {
606 try 606 try
607 { 607 {
608 boost::mutex::scoped_lock lock(databaseMutex_); // TODO - REMOVE
609
610 if (readOperations != NULL) 608 if (readOperations != NULL)
611 { 609 {
612 /** 610 /**
613 * IMPORTANT: In Orthanc <= 1.9.1, there was no transaction 611 * IMPORTANT: In Orthanc <= 1.9.1, there was no transaction
614 * in this case. This was OK because of the presence of the 612 * in this case. This was OK because of the presence of the
615 * global mutex protecting the database. 613 * global mutex that was protecting the database.
616 **/ 614 **/
617 615
618 Transaction transaction(db_, *factory_, TransactionType_ReadOnly); // TODO - Only if not "TransactionType_Implicit" 616 Transaction transaction(db_, *factory_, TransactionType_ReadOnly); // TODO - Only if not "TransactionType_Implicit"
619 { 617 {
620 ReadOnlyTransaction t(transaction.GetDatabaseTransaction(), transaction.GetContext()); 618 ReadOnlyTransaction t(transaction.GetDatabaseTransaction(), transaction.GetContext());
680 } 678 }
681 679
682 680
683 void StatelessDatabaseOperations::FlushToDisk() 681 void StatelessDatabaseOperations::FlushToDisk()
684 { 682 {
685 boost::mutex::scoped_lock lock(databaseMutex_);
686
687 try 683 try
688 { 684 {
689 db_.FlushToDisk(); 685 db_.FlushToDisk();
690 } 686 }
691 catch (OrthancException&) 687 catch (OrthancException&)