Do we have any other differences other than the below? Also please validate whether the below are correct
SessionFactory
objects are one per application and Session
objects are one per client.SessionFactory
is to create and manage Sessions
. Session
is to provide a CRUD interface for
mapped classes, and also access to the more versatile Criteria API
. SessionFactory
is thread safe where as Session
is not thread safeFirst of all, asking the difference between these interfaces doesn't make any sense. It seems like asking the difference between car manufacturing plant and car. A manufacturing plant is a place where the cars will be produced. Similarly, SessionFactory
is an instance which will create Session
objects.