diff --git a/dbcon/dmlpackageproc/dmlpackageprocessor.cpp b/dbcon/dmlpackageproc/dmlpackageprocessor.cpp index 307ba1d39..676fab0ef 100644 --- a/dbcon/dmlpackageproc/dmlpackageprocessor.cpp +++ b/dbcon/dmlpackageproc/dmlpackageprocessor.cpp @@ -350,7 +350,7 @@ int DMLPackageProcessor::rollBackTransaction(uint64_t uniqueId, BRM::TxnID txnID while (1) { - if (msgRecived == fWEClient->getPmCount()) + if (msgRecived == fWEClient->getRWConnections()) break; fWEClient->read(uniqueId, bsIn); diff --git a/writeengine/client/we_clients.cpp b/writeengine/client/we_clients.cpp index ffb0e9dee..2e496cb92 100644 --- a/writeengine/client/we_clients.cpp +++ b/writeengine/client/we_clients.cpp @@ -310,6 +310,11 @@ void WEClients::Setup() } } +bool WEClient::isConectionReadonly(uint32_t connection) +{ + return fPmConnections[connection] == nullptr; +} + int WEClients::Close() { makeBusy(false); @@ -502,9 +507,9 @@ void WEClients::write(const messageqcpp::ByteStream& msg, uint32_t connection) else { // new behavior: connection client is nullptr means it is read-only. -// ostringstream os; -// os << "Lost connection to WriteEngineServer on pm" << connection; -// throw runtime_error(os.str()); + ostringstream os; + os << "Connection to readonly pm" << connection; + throw runtime_error(os.str()); } } diff --git a/writeengine/client/we_clients.h b/writeengine/client/we_clients.h index 8a512f732..a5e5a4e66 100644 --- a/writeengine/client/we_clients.h +++ b/writeengine/client/we_clients.h @@ -114,6 +114,18 @@ class WEClients return pmCount; } + uint32_t getRWConnections() + { + uint32_t count = 0; + for (uint32_t i = 0; i < fPmConnections.size(); i++) + { + count += fPmConnections[i] != nullptr; + } + return count; + } + + bool connectionIsReadonly(uint32_t connection); + private: WEClients(const WEClients& weClient); WEClients& operator=(const WEClients& weClient);