spring-framework / org.springframework.orm.hibernate5.support / OpenSessionInterceptor / <init>

<init>

OpenSessionInterceptor()

Simple AOP Alliance MethodInterceptor implementation that binds a new Hibernate Session for each method invocation, if none bound before.

This is a simple Hibernate Session scoping interceptor along the lines of OpenSessionInViewInterceptor, just for use with AOP setup instead of MVC setup. It opens a new Session with flush mode "MANUAL" since the Session is only meant for reading, except when participating in a transaction.

Author
Juergen Hoeller

Since
4.2

See Also
OpenSessionInViewInterceptorOpenSessionInViewFilterorg.springframework.orm.hibernate5.HibernateTransactionManagerTransactionSynchronizationManagerSessionFactory#getCurrentSession()