throw new IllegalStateException("Transaction " + tx + " does not exist, wsatResource=" + wsatResource);
Xid xidFromActivityMap = activityXidToInternalXidMap.get(xid);
BranchRecord branch;
if(xidFromActivityMap!=null) {
branch = getBranch(xidFromActivityMap);
WSATXAResource resource = (WSATXAResource) branch.exists(wsatResource);
if (resource!=null) return resource.getXid();
}
// enlist primary, read-only branch (ensures 2PC)
tx.enlistResource(new WSATNoOpXAResource());
synchronized(currentXidLock) {
tx.enlistResource(new WSATGatewayRMPeerRecoveryDelegate());