[cdi-dev] what Bean<T> implementations need to be PassivationCapable?
struberg at yahoo.de
Mon Mar 18 14:02:19 EDT 2013
By catching an issue we have with the custom Bean<T> implementations provided by Spring Data, I got aware of a possible issue with PassivationCapable.
Which Bean<T> need to implement PassivationCapable?
6.6.1 seem to indicate that only beans or passivating scopes need a PassivationCapable bean.
But in this case: how does a container implement the NormalScope proxies for such a Bean? Consider we inject such a Contextual Reference of such a Bean<T> (which does _not_ implement PassivationCapable), e.g. MyDataRepository into a @SessionScoped bean. And now clustering kicks in and we propagate our @SessionScoped bean to another node.
What happens with the proxy for MyDataRepository? How will it 'reconnect' to the correct Bean<T> on the other side of the cluster? Imo this is only possible if all Bean<T> properly implement PassivationCapable.
Or should we use the bean type + qualifiers to create a synthetic passivationId? Does this hold waters?
More information about the cdi-dev