Class CurrentSessionContext

  • All Implemented Interfaces:
    java.io.Serializable, org.hibernate.context.CurrentSessionContext

    public class CurrentSessionContext
    extends org.hibernate.context.JTASessionContext
    Implementation of Hibernate's current_session_context_class extension point. During the move to strict JTA compliance, nested calls to HibernateTemplate and SessionFactoryUtils#getSession() were causing "Session is closed" during CacheSynchronization. See resources/ome/services/hibernate.xml
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.hibernate.context.JTASessionContext

        org.hibernate.context.JTASessionContext.CleanupSynch
    • Field Summary

      • Fields inherited from class org.hibernate.context.JTASessionContext

        factory
    • Constructor Summary

      Constructors 
      Constructor Description
      CurrentSessionContext​(org.hibernate.engine.SessionFactoryImplementor sf)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.hibernate.classic.Session buildOrObtainSession()  
      protected boolean isAutoCloseEnabled()  
      • Methods inherited from class org.hibernate.context.JTASessionContext

        currentSession, getConnectionReleaseMode, isAutoFlushEnabled
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CurrentSessionContext

        public CurrentSessionContext​(org.hibernate.engine.SessionFactoryImplementor sf)
    • Method Detail

      • buildOrObtainSession

        protected org.hibernate.classic.Session buildOrObtainSession()
        Overrides:
        buildOrObtainSession in class org.hibernate.context.JTASessionContext
      • isAutoCloseEnabled

        protected boolean isAutoCloseEnabled()
        Overrides:
        isAutoCloseEnabled in class org.hibernate.context.JTASessionContext