// messages to be cancelled to the server which means they would be available for other
// consumers to consume. If another consumer then consumes them, then recover() is called
// and the original transaction is committed, then this means the same message has been
// delivered twice which breaks the once and only once delivery guarantee.
if (rm.checkForAcksInSession(state.getSessionID()))
{
throw new IllegalStateException(
"Attempt to close an XASession when there are still uncommitted acknowledgements!");
}
}