此版本仍在开发中,尚不被认为是稳定的。对于最新的稳定版本,请使用 Spring Framework 6.2.10spring-doc.cadn.net.cn

@AfterTransaction

@AfterTransaction表示带注释的void方法应该在 transaction 已结束,对于已配置为在 使用 Spring 的@Transactional注解。@AfterTransaction方法 不需要public并且可以在基于 Java 8 的接口默认值上声明 方法。spring-doc.cadn.net.cn

@AfterTransaction (1)
void afterTransaction() {
	// logic to be run after a transaction has ended
}
1 在事务后运行此方法。
@AfterTransaction (1)
fun afterTransaction() {
	// logic to be run after a transaction has ended
}
1 在事务后运行此方法。