summaryrefslogtreecommitdiff
path: root/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2012-07-31 13:35:53 +0000
committerKim van der Riet <kpvdr@apache.org>2012-07-31 13:35:53 +0000
commit63c6598f401ac6406e5a31c602c7892b798536fc (patch)
tree73b3c1a519ada213c9e117244aab99d2e64d4f2a /cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp
parentb435b07eb8fa9db484f85b39daaf43642dd623ca (diff)
downloadqpid-python-63c6598f401ac6406e5a31c602c7892b798536fc.tar.gz
QPID-3858: WIP: Durable transactions fixed
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1367535 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp')
-rw-r--r--cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp b/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp
index 7d9aaceb11..974f3f3981 100644
--- a/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp
+++ b/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp
@@ -49,12 +49,10 @@ MessageProducer::MessageProducer(const TestOptions& perfTestParams,
m_queue(queue)
{}
-MessageProducer::~MessageProducer()
-{}
+MessageProducer::~MessageProducer() {}
void*
-MessageProducer::runProducers()
-{
+MessageProducer::runProducers() {
const bool useTxns = m_perfTestParams.m_enqTxnBlockSize > 0U;
uint16_t recsInTxnCnt = 0U;
qpid::broker::TxnBuffer* tb = 0;
@@ -68,17 +66,13 @@ MessageProducer::runProducers()
op->deliverTo(m_queue);
tb->enlist(op);
if (++recsInTxnCnt >= m_perfTestParams.m_enqTxnBlockSize) {
- if (m_perfTestParams.m_durable) {
- tb->commitLocal(m_store);
+ tb->commitLocal(m_store);
- // TxnBuffer instance tb carries async state that precludes it being re-used for the next
- // transaction until the current commit cycle completes. So use another instance. This
- // instance should auto-delete when the async commit cycle completes.
- if ((numMsgs + 1) < m_perfTestParams.m_numMsgs) {
- tb = new qpid::broker::TxnBuffer(m_resultQueue);
- }
- } else {
- tb->commit();
+ // TxnBuffer instance tb carries async state that precludes it being re-used for the next
+ // transaction until the current commit cycle completes. So use another instance. This
+ // instance should auto-delete when the async commit cycle completes.
+ if ((numMsgs + 1) < m_perfTestParams.m_numMsgs) {
+ tb = new qpid::broker::TxnBuffer(m_resultQueue);
}
recsInTxnCnt = 0U;
}
@@ -87,11 +81,7 @@ MessageProducer::runProducers()
}
}
if (recsInTxnCnt) {
- if (m_perfTestParams.m_durable) {
- tb->commitLocal(m_store);
- } else {
- tb->commit();
- }
+ tb->commitLocal(m_store);
}
return reinterpret_cast<void*>(0);
}