Multiple choice technology programming languages

Is the Session threadsafe in Hibernate ?

  1. True

  2. False

  3. No matter

  4. None of the above

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

Hibernate Session is a non-thread-safe object representing a single database transaction/unit of work and must not be shared. If multiple threads access a session concurrently, it causes race conditions and data corruption. Conversely, SessionFactory is thread-safe and designed for global, multi-threaded use.