[cdi-dev] [JBoss JIRA] (CDI-275) clarify behavior of stateful beans (EJB) and cdi scopes

Mark Struberg (JIRA) jira-events at lists.jboss.org
Fri Oct 5 13:35:03 EDT 2012


    [ https://issues.jboss.org/browse/CDI-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12724469#comment-12724469 ] 

Mark Struberg commented on CDI-275:
-----------------------------------

guess that 3.2.1. "EJB remove methods of session beans" answers this

{quote}
If a session bean is a stateful session bean:
• If the scope is @Dependent, the application may call any EJB remove method of a contextual instance of the session bean.
• Otherwise, the application may not directly call any EJB remove method of any contextual instance of the session bean.
If the application directly calls an EJB remove method of a contextual instance of a session bean that is a stateful session bean and declares any scope other than @Dependent, an UnsupportedOperationException is thrown.
If the application directly calls an EJB remove method of a contextual instance of a session bean that is a stateful session bean and has scope @Dependent then no parameters are passed to the method by the container. Furthermore, the container ignores the instance instead of destroying it when Contextual.destroy() is called, as defined in Section 7.3.2, “Lifecycle of stateful session beans”.
{quote}
                
> clarify behavior of stateful beans (EJB) and cdi scopes
> -------------------------------------------------------
>
>                 Key: CDI-275
>                 URL: https://issues.jboss.org/browse/CDI-275
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>            Reporter: Romain Manni-Bucau
>
> EJB specification let think the Stateful beans should be user managed so what about the integration with CDI and in particular the @Remoe methods
> I think it is not so clear in the current specification and that @requestScoped (or session...) on a statful bean should be clarified

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the cdi-dev mailing list