You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

TransactionScoped Bean的@PreDestroy方法应在事务结束前还是后执行?

Quarkus TransactionScoped Bean @PreDestroy 调用时机确认
  • Quarkus官方文档《事务使用指南》明确说明,@TransactionScoped Bean的@PreDestroy方法会在事务结束前被调用(基于3.5.0版本文档内容)。
  • 但存在测试代码显示,该方法实际在事务结束后才执行,与文档描述不符。

请确认:@PreDestroy方法的调用时机到底是事务结束前(如文档所述),还是事务结束后(如测试结果所示)?


内容的提问来源于stack exchange,提问作者João Martins

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.06 22:12:04