Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个需要很长时间才能计算的过程,因此它被标记为@Asynchronous无状态 EJB。当该过程完成时,我希望它从会话中访问一个SessionScopedbean,该会话启动了该过程以存储结果。
@Asynchronous
SessionScoped
那可能吗?如何?
您可以@Inject使用所需的 EJB,但这可能行不通,因为您无法保证在异步方法调用完成时会话仍然可用。如果您想使用异步方法,您可能必须找到另一个解决方案。
@Inject