mmatloka
mmatloka

Reputation: 2014

Serializability of injected CDI bean into stateful EJB

I've got stateful EJB and injected to it application scope CDI bean. Findbugs gave a warning, because my CDI bean was not serializable. Should the CDI bean be serializable in this case? In my opinion it shouldn't, in order to avoid passivation. Is making this field 'transient' enough, and is this a proper solution?

Upvotes: 0

Views: 186

Answers (1)

LightGuard
LightGuard

Reputation: 5378

I wouldn't worry about it honestly. You're probably getting a PassivationCapable proxy in reality and FindBugs certainly doesn't know that.

Upvotes: 1

Related Questions