有没有办法在xml中替换以下Spring配置:
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" no-rollback-for="MyNoCausingRollbackException" />
</tx:attributes>
Run Code Online (Sandbox Code Playgroud)
带注释或 java 配置?
我的目标是以这种方式配置每个事务行为,因此抛出MyNoCausingRollbackException带有注释的方法@Transactional不会回滚当前事务。我想避免每次Transactional(noRollbackFor = ResourceNotFoundException.class)在可以抛出此类异常的方法上使用时定义此类行为。
我设置了一个非常简单的 .bat 文件来执行几个命令,这样我就不用每次都输入它们了,但是这些进程需要在 powershell 7 中运行。
如果我手动运行 powershell 7.0.3 然后运行命令一切正常,但是运行 .bat 脚本开始
powershell -Version 7.0.3 -Command {XXXXX};
Run Code Online (Sandbox Code Playgroud)
向我显示一条消息“无法启动 Windows PowerShell 版本 7.0.3,因为尚未安装。”
如果我尝试在没有版本号的情况下运行它,那么它会在 5.1.x 中运行,然后会失败,因为它需要 6+。