Question - Difference between Session and SessionFactory in Hibernate?
Answer -
This is yet another popular Hibernate Interview Question asked.
- A Session is a single-threaded, short-lived object. It provides the first-level cache.
- SessionFactory is immutable and shared by all Session. It also lives until the Hibernate is running. It also provides the second-level cache.