public int prepare(Xid xid) throws XAException {
// We allow interleaving multiple transactions, so
// we don't limit prepare to the associated xid.
ActiveMQXid x;
//THIS SHOULD NEVER HAPPEN because end(xid, TMSUCCESS) should have been called first
if (ActiveMQXid.equals(associatedXid,xid)) {
// x = activeXid;
throw new XAException(XAException.XAER_PROTO);
} else {
//TODO cache the known xids so we don't keep recreating this one??
x = new ActiveMQXid(xid);
}
XATransactionInfo info = new XATransactionInfo();
info.setId(this.packetIdGenerator.generateId());
info.setXid(x);