Skip to content

强制退出或宕机数据不能回滚? #15

Open
@YANGJINJUE

Description

@YANGJINJUE

@Transactional(rollbackFor = ServiceException.class) public void transfer(String sourceAcctId, String targetAcctId, double amount) throws ServiceException { this.remoteAccountService.decreaseAmount(sourceAcctId, amount); System.exit(-1); this.increaseAmount(targetAcctId, amount); }
跑的测试GenericConsumerMain,我在上述加入代码System.exit(-1)模拟宕机的场景,就是远程调用成功,账户1资金扣钱并冻结成功,当本地对账户2加钱前宕机了,那么后续我又启动恢复RecoverConsumerMain,账号1的钱还是有冻结金额?请问你们有碰到吗?还是说我测试问题?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions