public int prepare(final Xid xid) throws XAException {
if (LOG.isDebugEnabled()) {
LOG.debug("Prepare: " + xid);
}
XATransactionId x;
// �����ϲ�Ӧ�ó��������������Ϊend������prepare֮ǰ���ã�associatedXid�Ѿ�����Ϊnull��Ԥ��
if (xid == null || this.equals(this.associatedXid, xid)) {
throw new XAException(XAException.XAER_PROTO);
}
else {
x = new XATransactionId(xid, this.uniqueQualifier);
}
MetaStatLog.addStat(null, StatConstants.TX_PREPARE);
final TransactionInfo info =
new TransactionInfo(x, this.sessionId, TransactionInfo.TransactionType.PREPARE, this.uniqueQualifier);