- for (Iterator<Map->Entry<int64_t, Transaction> > *iter = liveTransactionBySequenceNumberTable->entrySet()->iterator(); iter->hasNext();) {
- Transaction *transaction = iter->next()->getValue();
-
- // Check if the transaction is dead
- int64_t lastTransactionNumber = lastArbitratedTransactionNumberByArbitratorTable->get(transaction->getArbitrator());
- if ((lastTransactionNumber != NULL) && (lastTransactionNumber >= transaction->getSequenceNumber())) {
-
- // Set dead the transaction
- transaction->setDead();
-
- // Remove the transaction from the live table
- iter->remove();
- liveTransactionByTransactionIdTable->remove(transaction->getId());
+ {
+ SetIterator<int64_t, Transaction *> * iter = getKeyIterator(liveTransactionBySequenceNumberTable);
+ while(iter->hasNext()) {
+ int64_t key = iter->next();
+ Transaction *transaction = liveTransactionBySequenceNumberTable->get(key);
+
+ // Check if the transaction is dead
+ if (lastArbitratedTransactionNumberByArbitratorTable->contains(transaction->getArbitrator()) && lastArbitratedTransactionNumberByArbitratorTable->get(transaction->getArbitrator() >= transaction->getSequenceNumber())) {
+ // Set dead the transaction
+ transaction->setDead();
+
+ // Remove the transaction from the live table
+ iter->remove();
+ liveTransactionByTransactionIdTable->remove(transaction->getId());
+ }