Transaction rolled back because it has been marked as rollback-only
时间: 2023-08-19 18:06:29 浏览: 78
Oracle_Receivables-Updates_to_Invoice_Interface_Lines.docx
回答: 当出现"Transaction rolled back because it has been marked as rollback-only"异常时,通常是由于事务被标记为只能回滚而导致的。这个异常通常在使用@Transactional注解进行嵌套事务时出现。\[1\]嵌套事务失效的原因可能是因为内部事务没有正确开启新的事务。为了解决这个问题,可以尝试在内部事务中显式地开启一个新的事务。\[3\]这样可以确保嵌套事务的正确执行。
#### 引用[.reference_title]
- *1* [Spring事务管理报错:Transaction rolled back because it has been marked as rollback-only](https://blog.csdn.net/qq_38478903/article/details/88929207)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [@Transactional嵌套事务失效异常Transaction rolled back because it has been marked as rollback-only](https://blog.csdn.net/xiyang_1990/article/details/125870203)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文