public class

SpringSessionContext

extends Object
java.lang.Object
   ↳ org.springframework.orm.hibernate3.SpringSessionContext

Class Overview

Implementation 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.

Summary

Public Constructors
SpringSessionContext(SessionFactoryImplementor sessionFactory)
Create a new SpringSessionContext for the given Hibernate SessionFactory.
Public Methods
Session currentSession()
Retrieve the Spring-managed Session for the current thread, if any.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SpringSessionContext (SessionFactoryImplementor sessionFactory)

Create a new SpringSessionContext for the given Hibernate SessionFactory.

Parameters
sessionFactory the SessionFactory to provide current Sessions for

Public Methods

public Session currentSession ()

Retrieve the Spring-managed Session for the current thread, if any.

Throws
HibernateException