You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by pm...@apache.org on 2013/09/05 09:29:37 UTC

svn commit: r1520245 - in /qpid/trunk/qpid/cpp/src/qpid/broker: SemanticState.cpp SessionState.cpp SessionState.h

Author: pmoravec
Date: Thu Sep  5 07:29:36 2013
New Revision: 1520245

URL: http://svn.apache.org/r1520245
Log:
fixing QPID-5108

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp?rev=1520245&r1=1520244&r2=1520245&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp Thu Sep  5 07:29:36 2013
@@ -168,12 +168,14 @@ void SemanticState::startTx()
 {
     txBuffer = TxBuffer::shared_ptr(new TxBuffer());
     session.getBroker().getBrokerObservers().startTx(txBuffer);
+    session.startTx(); //just to update statistics
 }
 
 void SemanticState::commit(MessageStore* const store)
 {
     if (!txBuffer) throw
         CommandInvalidException(QPID_MSG("Session has not been selected for use with transactions"));
+    session.commitTx(); //just to update statistics
     TxOp::shared_ptr txAck(static_cast<TxOp*>(new TxAccept(accumulatedAck, unacked)));
     txBuffer->enlist(txAck);
     if (txBuffer->commitLocal(store)) {
@@ -187,6 +189,7 @@ void SemanticState::rollback()
 {
     if (!txBuffer)
         throw CommandInvalidException(QPID_MSG("Session has not been selected for use with transactions"));
+    session.rollbackTx(); //just to update statistics
     txBuffer->rollback();
     accumulatedAck.clear();
 }

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp?rev=1520245&r1=1520244&r2=1520245&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp Thu Sep  5 07:29:36 2013
@@ -79,6 +79,24 @@ void SessionState::addManagementObject()
     }
 }
 
+void SessionState::startTx() {
+    if (mgmtObject) { mgmtObject->inc_TxnStarts(); }
+}
+
+void SessionState::commitTx() {
+    if (mgmtObject) {
+        mgmtObject->inc_TxnCommits();
+        mgmtObject->inc_TxnCount();
+    }
+}
+
+void SessionState::rollbackTx() {
+    if (mgmtObject) {
+        mgmtObject->inc_TxnRejects();
+        mgmtObject->inc_TxnCount();
+    }
+}
+
 SessionState::~SessionState() {
     asyncCommandCompleter->cancel();
     semanticState.closed();

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h?rev=1520245&r1=1520244&r2=1520245&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h Thu Sep  5 07:29:36 2013
@@ -127,6 +127,11 @@ class SessionState : public qpid::Sessio
     // belonging to inter-broker bridges
     void addManagementObject();
 
+    // transaction-related methods just to update statistics
+    void startTx();
+    void commitTx();
+    void rollbackTx();
+
   private:
     void handleCommand(framing::AMQMethodBody* method, const framing::SequenceNumber& id);
     void handleContent(framing::AMQFrame& frame, const framing::SequenceNumber& id);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org