jvarenina commented on a change in pull request #731:
URL: https://github.com/apache/geode-native/pull/731#discussion_r565912077
##########
File path: cppcache/src/TXId.cpp
##########
@@ -27,15 +27,27 @@ namespace apache {
namespace geode {
namespace client {
-std::atomic<int32_t> TXId::m_transactionId(1);
+std::atomic<int32_t> TXId::m_transactionId(0);
-TXId::TXId() : m_TXId(m_transactionId++) {}
+TXId::TXId() {
+ // If m_transactionId has reached maximum value, then set
+ // it to zero in order to avoid overflow to negative value.
+ auto maxValueTXId = INT32_MAX;
Review comment:
Thanks, done.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]