@Singleton @Startup @PostConstruct method guaranteed to return before EJBs made available for client calls?

眉间皱痕 提交于 2019-12-05 02:01:42
  1. Yes, the container waits for the @PostConstruct method of all @Startup beans in the module ("EJB application") to return before allowing any client requests.
  2. Yes, this is the case in WebSphere Application Server as implied by the Developing singleton session beans topic in the Knowledge Center, which says "A PostConstruct method in a singleton bean can create an EJB timer [...] However, to avoid a deadlock, the PostConstruct method must not wait for an EJB timer to run". In other words, timer callback invocations will wait for @PostConstruct methods to complete, so @PostConstruct methods must not wait for timer callback invocations to complete.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!