org.springframework.orm.hibernate4

## Class SessionHolder

- java.lang.Object
- - org.springframework.transaction.support.ResourceHolderSupport
  - - org.springframework.orm.hibernate4.SessionHolder

- All Implemented Interfaces:
    ResourceHolder

      public class SessionHolder
      extends ResourceHolderSupport

  Session holder, wrapping a Hibernate Session and a Hibernate Transaction. HibernateTransactionManager binds instances of this class to the thread, for a given SessionFactory.

  Note: This is an SPI class, not intended to be used by applications.

  Since:
    3.1
  Author:
    Juergen Hoeller
  See Also:
    `HibernateTransactionManager`, `SessionFactoryUtils`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SessionHolder(Session session)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clear the transactional state of this resource holder.
    `FlushMode` | `getPreviousFlushMode()`
    `Session` | `getSession()`
    `Transaction` | `getTransaction()`
    `void` | `setPreviousFlushMode(FlushMode previousFlushMode)`
    `void` | `setTransaction(Transaction transaction)`

    - ### Methods inherited from class org.springframework.transaction.support.ResourceHolderSupport

      `getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unbound`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SessionHolder

          public SessionHolder(Session session)

  - ### Method Detail

    - #### getSession

          public Session getSession()

    - #### setTransaction

          public void setTransaction(Transaction transaction)

    - #### getTransaction

          public Transaction getTransaction()

    - #### setPreviousFlushMode

          public void setPreviousFlushMode(FlushMode previousFlushMode)

    - #### getPreviousFlushMode

          public FlushMode getPreviousFlushMode()

    - #### clear

          public void clear()

      Description copied from class: `ResourceHolderSupport`
      Clear the transactional state of this resource holder.
      Overrides:
        `clear` in class `ResourceHolderSupport`