Multiple choice java

When do you use a session bean?

  1. When you want to be certain your application data persists between program invocations, even in the event of a crash.

  2. If you need to initiate a database transaction.

  3. To process transient data that can be re-created in the event of a crash.

  4. To keep people who do not know how to program from accidentally changing important logic code

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

Session beans are intended to perform tasks for a client and handle transient data. Unlike Entity beans (or JPA entities), they are not designed for long-term data persistence. If a crash occurs, the conversational state of a session bean is typically lost, making them ideal for transient business logic.