Search in sources :

Example 1 with FailedToSendBranchRollbackRequest

use of io.seata.core.exception.TransactionExceptionCode.FailedToSendBranchRollbackRequest in project seata by seata.

the class AbstractCore method branchRollback.

@Override
public BranchStatus branchRollback(GlobalSession globalSession, BranchSession branchSession) throws TransactionException {
    try {
        BranchRollbackRequest request = new BranchRollbackRequest();
        request.setXid(branchSession.getXid());
        request.setBranchId(branchSession.getBranchId());
        request.setResourceId(branchSession.getResourceId());
        request.setApplicationData(branchSession.getApplicationData());
        request.setBranchType(branchSession.getBranchType());
        return branchRollbackSend(request, globalSession, branchSession);
    } catch (IOException | TimeoutException e) {
        throw new BranchTransactionException(FailedToSendBranchRollbackRequest, String.format("Send branch rollback failed, xid = %s branchId = %s", branchSession.getXid(), branchSession.getBranchId()), e);
    }
}
Also used : BranchRollbackRequest(io.seata.core.protocol.transaction.BranchRollbackRequest) FailedToSendBranchRollbackRequest(io.seata.core.exception.TransactionExceptionCode.FailedToSendBranchRollbackRequest) IOException(java.io.IOException) BranchTransactionException(io.seata.core.exception.BranchTransactionException) TimeoutException(java.util.concurrent.TimeoutException)

Aggregations

BranchTransactionException (io.seata.core.exception.BranchTransactionException)1 FailedToSendBranchRollbackRequest (io.seata.core.exception.TransactionExceptionCode.FailedToSendBranchRollbackRequest)1 BranchRollbackRequest (io.seata.core.protocol.transaction.BranchRollbackRequest)1 IOException (java.io.IOException)1 TimeoutException (java.util.concurrent.TimeoutException)1