EJB 3.1 有状态和 CDI 范围对话

发布于 2024-12-18 01:09:51 字数 313 浏览 4 评论 0原文

我有一个 @Stateful EJB,注释为 @ConversationScoped。客户端 (JSF) 向我的 EJB 发出请求,该请求:启动对话 - conversation.begin(),执行某些操作并向客户端显示响应。

然后,客户端发出另一个请求,EJB 执行某些操作并关闭对话 - conversation.end()

对话结束后,@Stateful EJB 是否被删除?或者我是否必须显式调用@Remove

I have a @Stateful EJB annotated as @ConversationScoped. The client (JSF) makes a request to my EJB which: starts the conversation - conversation.begin(), do something and shows the response to the client.

The client then makes another request, the EJB does something and closes the conversation - conversation.end().

Is the @Stateful EJB removed after the conversation end? Or do I have to explicitly call @Remove?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一身软味 2024-12-25 01:09:51

CDI 规范规定,当创建或销毁作用域时,会自动创建和销毁作用域 EJB。 Conversation 范围也是如此。因此,您不应尝试调用 @Remove 方法。

http://docs.jboss.org/cdi/spec/1.0 /html/concepts.html#d0e1066

The CDI specs say that the scoped EJBs are automatically created and destroyed when the scope is created or destroyed. The same is true for the Conversation scope. So, you should not try to call a @Remove method.

http://docs.jboss.org/cdi/spec/1.0/html/concepts.html#d0e1066

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文