We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// pub.dtm.client.barrier.BranchBarrier#insertBarrier
private boolean insertBarrier(Connection connection) throws SQLException { log.info("insert barrier {}", this); if (Objects.isNull(connection)) { return false; } PreparedStatement preparedStatement = null; try { String sql = "insert ignore into barrier(trans_type, gid, branch_id, op, barrier_id, reason) values(?,?,?,?,?,?)"; preparedStatement = connection.prepareStatement(sql); preparedStatement.setString(1, this.getTransTypeEnum().getValue()); preparedStatement.setString(2, this.getGid()); preparedStatement.setString(3, branchId); preparedStatement.setString(4, op); preparedStatement.setString(5, String.format("%02d", barrierId)); preparedStatement.setString(6, op);
if (preparedStatement.executeUpdate() == 0) { return false; } if (ParamFieldConstants.CANCEL.equals(op)) { int opIndex = 4; preparedStatement.setString(opIndex, ParamFieldConstants.TRY); if (preparedStatement.executeUpdate() > 0) { return false; } } } finally { if (Objects.nonNull(preparedStatement)) { preparedStatement.close(); } } return true; }
这个地方,只判断了ParamFieldConstants.CANCEL.equals(op),而Saga模式的补偿op是compensate,不是cancel
The text was updated successfully, but these errors were encountered:
No branches or pull requests
// pub.dtm.client.barrier.BranchBarrier#insertBarrier
private boolean insertBarrier(Connection connection) throws SQLException {
log.info("insert barrier {}", this);
if (Objects.isNull(connection)) {
return false;
}
PreparedStatement preparedStatement = null;
try {
String sql = "insert ignore into barrier(trans_type, gid, branch_id, op, barrier_id, reason) values(?,?,?,?,?,?)";
preparedStatement = connection.prepareStatement(sql);
preparedStatement.setString(1, this.getTransTypeEnum().getValue());
preparedStatement.setString(2, this.getGid());
preparedStatement.setString(3, branchId);
preparedStatement.setString(4, op);
preparedStatement.setString(5, String.format("%02d", barrierId));
preparedStatement.setString(6, op);
这个地方,只判断了ParamFieldConstants.CANCEL.equals(op),而Saga模式的补偿op是compensate,不是cancel
The text was updated successfully, but these errors were encountered: