【发布时间】:2018-10-05 13:53:51
【问题描述】:
我有一个使用这种方法的@Singleton ejb 类。事务在方法主体的末尾提交,但我在 myRunnable 线程中有一些其他的东西,我希望它包含在当前事务中。有什么办法吗?
@PostConstruct
public void init() {
try {
// do some other stuff
managedExecutorService.execute(myRunnable);
} catch (Exception e) {
LOG.error("Error when initializing...", e);
}
}
【问题讨论】:
-
赞成以补偿奇怪的反对票。
标签: jakarta-ee transactions ejb