Add @Transactional annotation to support auto commit and rollback.

    @Transactional
    public void saveUserInTransactionAndExceptionOccurs(User user) {
        user.save();
        throw new IllegalStateException("Can not connect to remote service, need rollback");
    }

    @Transactional
    public void saveUserInTransactionAndNoExceptionOccurs(User user) {
        user.save();
    }