summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/TxBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker/TxBuffer.cpp')
-rw-r--r--cpp/src/qpid/broker/TxBuffer.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/cpp/src/qpid/broker/TxBuffer.cpp b/cpp/src/qpid/broker/TxBuffer.cpp
index 0529892930..fe2ea8fbb1 100644
--- a/cpp/src/qpid/broker/TxBuffer.cpp
+++ b/cpp/src/qpid/broker/TxBuffer.cpp
@@ -17,30 +17,28 @@
*/
#include "qpid/broker/TxBuffer.h"
+using std::mem_fun;
using namespace qpid::broker;
bool TxBuffer::prepare(TransactionalStore* const store){
- if(store) store->begin();
+ TransactionContext* ctxt(0);
+ if(store) ctxt = store->begin();
for(op_iterator i = ops.begin(); i < ops.end(); i++){
- if(!(*i)->prepare()){
- if(store) store->abort();
+ if(!(*i)->prepare(ctxt)){
+ if(store) store->abort(ctxt);
return false;
}
}
- if(store) store->commit();
+ if(store) store->commit(ctxt);
return true;
}
void TxBuffer::commit(){
- for(op_iterator i = ops.begin(); i < ops.end(); i++){
- (*i)->commit();
- }
+ for_each(ops.begin(), ops.end(), mem_fun(&TxOp::commit));
}
void TxBuffer::rollback(){
- for(op_iterator i = ops.begin(); i < ops.end(); i++){
- (*i)->rollback();
- }
+ for_each(ops.begin(), ops.end(), mem_fun(&TxOp::rollback));
}
void TxBuffer::enlist(TxOp* const op){