Class SpringSessionContext
- java.lang.Object
- org.springframework.orm.hibernate3.SpringSessionContext
- All Implemented Interfaces:
Serializable
,CurrentSessionContext
@Deprecated public class SpringSessionContext extends Object implements CurrentSessionContext
Deprecated.as of Spring 4.3, in favor of Hibernate 4.x/5.xImplementation of Hibernate 3.1's CurrentSessionContext interface that delegates to Spring's SessionFactoryUtils for providing a Spring-managed current Session.Used by Spring's
LocalSessionFactoryBean
when told to expose a transaction-aware SessionFactory. This is the default as of Spring 2.5.This CurrentSessionContext implementation can also be specified in custom SessionFactory setup through the "hibernate.current_session_context_class" property, with the fully qualified name of this class as value.
- Since:
- 2.0
- Author:
- Juergen Hoeller
- See Also:
SessionFactoryUtils.doGetSession(org.hibernate.SessionFactory, boolean)
,AbstractSessionFactoryBean.setExposeTransactionAwareSessionFactory(boolean)
, Serialized Form
Constructor Summary
Constructors Constructor Description SpringSessionContext(SessionFactoryImplementor sessionFactory)
Deprecated.Create a new SpringSessionContext for the given Hibernate SessionFactory.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Session
currentSession()
Deprecated.Retrieve the Spring-managed Session for the current thread, if any.
Constructor Detail
SpringSessionContext
public SpringSessionContext(SessionFactoryImplementor sessionFactory)
Deprecated.Create a new SpringSessionContext for the given Hibernate SessionFactory.- Parameters:
sessionFactory
- the SessionFactory to provide current Sessions for
Method Detail
currentSession
public Session currentSession() throws HibernateException
Deprecated.Retrieve the Spring-managed Session for the current thread, if any.- Specified by:
currentSession
in interfaceCurrentSessionContext
- Throws:
HibernateException