When to use stateful session bean?
-
No data for a client
-
Beans needs to hold information across method invocations.
-
when business object should be stored
-
to send data for a specific application
Stateful session beans are specifically designed to maintain conversational state with a specific client across multiple method invocations. This makes them ideal for multi-step workflows like shopping carts or wizard-style processes. Option B correctly describes this use case. Option A describes stateless beans. Options C and D are misleading.
A stateful session bean is used when the bean needs to retain conversational state across multiple method calls from the same client, such as tracking items in a shopping cart during a session. This distinguishes it from stateless beans, which don't preserve any client-specific data between invocations.