[cdi-dev] [JBoss JIRA] Commented: (CDI-136) Assumption all @Stateful beans should be passivation capable
Pete Muir (JIRA)
jira-events at lists.jboss.org
Tue Jun 21 09:26:24 EDT 2011
[ https://issues.jboss.org/browse/CDI-136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610069#comment-12610069 ]
Pete Muir commented on CDI-136:
-------------------------------
Personally, I have no idea why we impose this additional rule for SFSBs, it seems to stray into specifying how EJBs actually work. I would prefer to remove this, making the paragraph say:
{quote}
For every bean which declares a passivating scope, the container must validate that the bean truly is passivation capable and that, in addition, its dependencies are passivation capable.
{quote}
This then removes any special case for EJBs and restricts the checks to those that make sense for CDI itself. If EJB wishes to introduce additional checks for SFSBs then they are free to do so.
David, WDYT? AIUI this solves the problem you have raised, but perhaps I have missed something?
> Assumption all @Stateful beans should be passivation capable
> ------------------------------------------------------------
>
> Key: CDI-136
> URL: https://issues.jboss.org/browse/CDI-136
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Beans, Java EE integration
> Affects Versions: 1.0
> Reporter: David Blevins
> Fix For: 1.1 (Proposed)
>
>
> Stateful session beans in transactions can't be passivated and shouldn't have passivation requirements either, like request scope.
> Stateful beans can be any scope. They are the Bertie Bott's Every Flavor Beans of EJB. It's too big of a brush to say that passivation is always required. That's the part we need to fix.
> Stateful session beans that do passivate are pretty rare. They should be assumed to be @NormalScope unless otherwise specified.
> The user should be able to say if they want passivation validation on their stateful bean and dependencies.
> We should at a minimum change the related language of the spec to be "For every bean which declares a passivating scope, and for every stateful session bean ***that requires passivation***, " and discuss how to determine that an SFSB requires passivation.
> From the EJB perspective this has always been a container detail, but we could have a rule in CDI that states the checks are not enforced unless the bean class explicitly implements java.io.Serializable. Alternatively we could make a generic @PassivationScoped annotation for other architectures that have flexible scopes and support passivation concepts.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the cdi-dev
mailing list