{
// the session is non-XA and transacted, or XA and enrolled in a global transaction. An
// XA session that has not been enrolled in a global transaction behaves as a
// transacted session.
ConnectionState connState = (ConnectionState)state.getParent();
if (trace) { log.trace("sending acknowlegment transactionally, queueing on resource manager"); }
// If the ack is for a delivery that came through via a connection consumer then we use
// the connectionConsumer session as the session id, otherwise we use this sessions'
// session ID
ClientSessionDelegate connectionConsumerDelegate =
(ClientSessionDelegate)info.getConnectionConsumerSession();
String sessionId = connectionConsumerDelegate != null ?
connectionConsumerDelegate.getID() : state.getSessionID();
if (info.getSource() != null)
{
//from a normal session (non CC).
result = state.addAckToResourceManager(connState.getResourceManager(), txID, sessionId, info);
}
else
{
connState.getResourceManager().addAck(txID, sessionId, info);
}
}
}
}