[cdi-dev] CDI-136: Validation of passivation capability for SFSBs

Mark Struberg struberg at yahoo.de
Sun Jun 26 18:03:48 EDT 2011


EntityManagers are always stateful and _never_ safe to be assumed Serializable. Even if one JPA provider would provide a Serializable EntityManager (the only one I know is eBean, but it's not fully JPA compatible) you would end up creating a non-portable application!


--- On Wed, 6/22/11, Marina Vatkina <marina.vatkina at oracle.com> wrote:

> From: Marina Vatkina <marina.vatkina at oracle.com>
> Subject: Re: [cdi-dev] CDI-136: Validation of passivation capability for SFSBs
> To: "Pete Muir" <pmuir at redhat.com>
> Cc: "Carlo de Wolf" <cdewolf at redhat.com>, "Marina Vatkina" <Marina.Vatkina at sun.com>, "cdi-dev" <cdi-dev at lists.jboss.org>
> Date: Wednesday, June 22, 2011, 9:10 PM
> EJB spec usually doesn't mandate much
> validation. The only issue that I've seen with SFSB
> passivation was when it had a ref to an extended EM. It's
> not clear what does it mean for an EM to be serializable
> (the interface is not), so the JPA provider needs to be
> involved. But that would be a question for the JPA spec.
> Otherwise I haven't seen any requests...
> My $.02.
> -marina
> Pete Muir wrote:
> > All,
> >
> > David Blevins raised this issue https://issues.jboss.org/browse/CDI-136 about CDI
> overstepping the it's responsibilities and validating that
> every SFSB must be passivation capable, not just those that
> belong to passivation capable scopes in CDI.
> >
> > I would assume this check was introduced because of a
> misinterpretation of the EJB spec that *all* SFSBs are
> passivation capable, not just some. Speaking to David, he
> has indicated this is certainly not the case. In this case,
> I think CDI is being somewhat presumptious and should
> validate only the beans that it needs to (those that belong
> to passivation capable scopes in CDI).
> >
> > EJB does not offer up any metadata about whether a
> SFSB is passivation capable, so I think this is the best we
> can do. Might be something for the EJB EG to consider -
> Marina, happy to raise there if you want?
> >
> > I will create a pull req for this issue shortly with
> the proposed fix, please comment on the issue as ever if you
> do not agree with the fix, within the next two weeks.
> >
> > Pete
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev

More information about the cdi-dev mailing list