}
try {
TransactionBroker[] brokers = translist.getClusterTransactionBrokers(cpcTid);
if (brokers == null) continue;
boolean completed = true;
BrokerAddress to = null;
for (int j = 0; j < brokers.length; j++) {
if (!brokers[j].isCompleted()) {
completed = false;
to = brokers[j].getCurrentBrokerAddress();
if (to != null) {
if (to.equals(Globals.getMyAddress()) && to.equals(brokers[j].getBrokerAddress())) {
try {
translist.completeClusterTransactionBrokerState(cpcTid,
TransactionState.COMMITTED, to, true);
} catch (Exception e) {
logger.logStack(logger.WARNING,
"Unable to update transaction broker state for "+to+", TUID="+cpcTid, e);
}
if (!Globals.getHAEnabled()) {
continue;
}
}
if (activatedBrokers.size() == 0 &&
processState != null && processState == ClusterPCommittedState.PROCCESSED) {
continue;
}
if (activatedBrokers.size() == 0 && !to.equals(Globals.getMyAddress()) &&
processState != null && processState != ClusterPCommittedState.TAKEOVER) {
continue;
}
if (activatedBrokers.size() > 0 &&
!activatedBrokers.contains(to.getMQAddress()) &&
!to.equals(Globals.getMyAddress()) &&
processState != null && processState != ClusterPCommittedState.TAKEOVER) {
continue;
}
if (TransactionList.DEBUG_CLUSTER_TXN) {