Week 3 - Stateful Session Beans (SFSB) Flashcards
SFSB are dedicated to one client (T or F)
T
SFSB are long-lived (T or F)
F
SFSB use instance pooling (T or F)
F - SLSB do
SFSB are susceptible to passivation and activation (T or F)
T
Why might a stateful session bean implement session synchronization?
jakarta.ejb.SessionSynchronization
Allows the bean to take action before or after a transaction.
With session synchronization, you can be sure that your state changes are synchronized with the commit or rollback of the transaction. This ensures data consistency and reliability across the entire transaction.
difference between stateful session bean and cdi bean?
Stateful Session Beans are used when you need to track client-specific state over multiple method calls (like for user sessions).
CDI Beans are more general-purpose and allow for dependency injection and flexible state management based on different scopes (like session or application-wide state).