Search in sources :

Example 1 with FailedToSendBranchCommitRequest

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

the class AbstractCore method branchCommit.

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

Aggregations

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