What’s the difference between Session and SessionFactory?
A Session provides the first-level cache and is a single-threaded, short-lived object. A SessionFactory provides the second-level cache and is immutable and shared by all Sessions. It lives until Hibernate is running.