pivotal-jbarrett commented on a change in pull request #731:
URL: https://github.com/apache/geode-native/pull/731#discussion_r566303726
##########
File path: cppcache/src/TXId.cpp
##########
@@ -27,15 +27,34 @@ 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 start again
+ // from zero, and increment by one until first unused value is found.
+ // This is done to avoid overflow of m_transactionId to negative value.
+ auto maxValueTXId = std::numeric_limits<int>::max();
Review comment:
Unused.
----------------------------------------------------------------
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]