Class JTASessionContext

    • Constructor Detail

      • JTASessionContext

        public JTASessionContext​(SessionFactoryImplementor factory)
        Constructs a JTASessionContext
        Parameters:
        factory - The factory this context will service
    • Method Detail

      • currentSession

        public Session currentSession()
                               throws HibernateException
        Description copied from interface: CurrentSessionContext
        Retrieve the current session according to the scoping defined by this implementation.
        Returns:
        The current session.
        Throws:
        HibernateException - Typically indicates an issue locating or creating the current session.
      • buildOrObtainSession

        protected Session buildOrObtainSession()
        Strictly provided for subclassing purposes; specifically to allow long-session support. This implementation always just opens a new session.
        Returns:
        the built or (re)obtained session.
      • isAutoCloseEnabled

        protected boolean isAutoCloseEnabled()
        Mainly for subclass usage. This impl always returns true.
        Returns:
        Whether the session should be closed by transaction completion.
      • isAutoFlushEnabled

        protected boolean isAutoFlushEnabled()
        Mainly for subclass usage. This impl always returns true.
        Returns:
        Whether the session should be flushed prior transaction completion.
      • getConnectionHandlingMode

        protected PhysicalConnectionHandlingMode getConnectionHandlingMode()
        Mainly for subclass usage. This impl always returns after_statement.
        Returns:
        The connection release mode for any built sessions.