public TransactionId[] getPreparedTransactions(final SessionContext context, final String uniqueQualifier)
throws Exception {
final List<TransactionId> txs = new ArrayList<TransactionId>();
synchronized (this.xaTransactions) {
for (final Iterator<XATransaction> iter = this.xaTransactions.values().iterator(); iter.hasNext();) {
final XATransaction tx = iter.next();
// Only tx that the unique qualifier is equals to the request
// one.
if (tx.isPrepared() && this.isValidTx(uniqueQualifier, tx)) {
if (LOG.isDebugEnabled()) {
LOG.debug("prepared transaction: " + tx.getTransactionId());
}
txs.add(tx.getTransactionId());
}
}
}
synchronized (this.xaHeuristicTransactions) {
// �ֹ������������prepare״̬��xa����
for (final Iterator<XATransaction> iter = this.xaHeuristicTransactions.values().iterator(); iter.hasNext();) {
final XATransaction tx = iter.next();
// Only tx that the unique qualifier is equals to the request
// one.
if (this.isValidTx(uniqueQualifier, tx)) {
txs.add(tx.getTransactionId());
}
}
}
final XATransactionId rc[] = new XATransactionId[txs.size()];
txs.toArray(rc);