Class SessionFactoryImpl

java.lang.Object
org.hibernate.impl.SessionFactoryImpl
All Implemented Interfaces:
Serializable, Referenceable, Mapping, SessionFactoryImplementor, SessionFactory

public final class SessionFactoryImpl extends Object implements SessionFactory, SessionFactoryImplementor
Concrete implementation of the SessionFactory interface. Has the following responsibilities
  • caches configuration settings (immutably)
  • caches "compiled" mappings ie. EntityPersisters and CollectionPersisters (immutable)
  • caches "compiled" queries (memory sensitive cache)
  • manages PreparedStatements
  • delegates JDBC Connection management to the ConnectionProvider
  • factory for instances of SessionImpl
This class must appear immutable to clients, even if it does all kinds of caching and pooling under the covers. It is crucial that the class is not only thread safe, but also highly concurrent. Synchronization must be used extremely sparingly.
See Also: