org.springframework.orm.hibernate3
Class SessionHolder

java.lang.Object
  extended by org.springframework.transaction.support.ResourceHolderSupport
      extended by org.springframework.orm.hibernate3.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:
1.2
Author:
Juergen Hoeller
See Also:
HibernateTransactionManager, SessionFactoryUtils

Constructor Summary
SessionHolder(Object key, org.hibernate.Session session)
           
SessionHolder(org.hibernate.Session session)
           
 
Method Summary
 void addSession(Object key, org.hibernate.Session session)
           
 void addSession(org.hibernate.Session session)
           
 void clear()
          Clear the transactional state of this resource holder.
 boolean containsSession(org.hibernate.Session session)
           
 boolean doesNotHoldNonDefaultSession()
           
 org.hibernate.Session getAnySession()
           
 org.hibernate.FlushMode getPreviousFlushMode()
           
 org.hibernate.Session getSession()
           
 org.hibernate.Session getSession(Object key)
           
 org.hibernate.Transaction getTransaction()
           
 org.hibernate.Session getValidatedSession()
           
 org.hibernate.Session getValidatedSession(Object key)
           
 boolean isEmpty()
           
 org.hibernate.Session removeSession(Object key)
           
 void setPreviousFlushMode(org.hibernate.FlushMode previousFlushMode)
           
 void setTransaction(org.hibernate.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(org.hibernate.Session session)

SessionHolder

public SessionHolder(Object key,
                     org.hibernate.Session session)
Method Detail

getSession

public org.hibernate.Session getSession()

getSession

public org.hibernate.Session getSession(Object key)

getValidatedSession

public org.hibernate.Session getValidatedSession()

getValidatedSession

public org.hibernate.Session getValidatedSession(Object key)

getAnySession

public org.hibernate.Session getAnySession()

addSession

public void addSession(org.hibernate.Session session)

addSession

public void addSession(Object key,
                       org.hibernate.Session session)

removeSession

public org.hibernate.Session removeSession(Object key)

containsSession

public boolean containsSession(org.hibernate.Session session)

isEmpty

public boolean isEmpty()

doesNotHoldNonDefaultSession

public boolean doesNotHoldNonDefaultSession()

setTransaction

public void setTransaction(org.hibernate.Transaction transaction)

getTransaction

public org.hibernate.Transaction getTransaction()

setPreviousFlushMode

public void setPreviousFlushMode(org.hibernate.FlushMode previousFlushMode)

getPreviousFlushMode

public org.hibernate.FlushMode getPreviousFlushMode()

clear

public void clear()
Description copied from class: ResourceHolderSupport
Clear the transactional state of this resource holder.

Overrides:
clear in class ResourceHolderSupport