Multiple choice technology embedded technologies

When to use stateful session bean?

  1. No data for a client

  2. Beans needs to hold information across method invocations.

  3. when business object should be stored

  4. to send data for a specific application

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

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.

AI explanation

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.