} else {
log.debug("Not waiting for the response, hope its there!");
}
if (returnData.isEmpty()
&& (flags & Connection.TPNOBLOCK) == Connection.TPNOBLOCK) {
throw new ConnectionException(Connection.TPEBLOCK,
"Did not receive a message");
} else if (returnData.isEmpty()) {
log.debug("Empty return data: " + callbackIOR);
if (JtsTransactionImple.hasTransaction()) {
try {
log.debug("Marking rollbackOnly");
JABTransaction.current().rollback_only();
} catch (JABException e) {
throw new ConnectionException(Connection.TPESYSTEM,
"Could not mark transaction for rollback only");
}
}
throw new ConnectionException(Connection.TPETIME,
"Did not receive a message");
} else {
Message message = returnData.remove(0);
if (message != null) {
log.debug("Message was available");
if (message.rval == EventListener.DISCON_CODE) {
if (JABTransaction.current() != null) {
try {
log.debug("Marking rollbackOnly as disconnection");
JABTransaction.current().rollback_only();
} catch (JABException e) {
throw new ConnectionException(
Connection.TPESYSTEM,
"Could not mark transaction for rollback only");
}
}
} else if (message.rcode == Connection.TPESVCERR) {
if (JABTransaction.current() != null) {
try {
log.debug("Marking rollbackOnly as svc err");
JABTransaction.current().rollback_only();
} catch (JABException e) {
throw new ConnectionException(
Connection.TPESYSTEM,
"Could not mark transaction for rollback only");
}
}
} else if (message.rval == Connection.TPFAIL) {
if (JABTransaction.current() != null) {
try {
JABTransaction.current().rollback_only();
} catch (JABException e) {
throw new ConnectionException(
Connection.TPESYSTEM,
"Could not mark transaction for rollback only");
}
}
}