The Spring Framework

org.springframework.orm.hibernate
Class SessionHolder

java.lang.Object
  extended by org.springframework.transaction.support.ResourceHolderSupport
      extended by org.springframework.orm.hibernate.SessionHolder

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:
06.05.2003
Author:
Juergen Hoeller
See Also:
HibernateTransactionManager, SessionFactoryUtils

Constructor Summary
SessionHolder(Object key, net.sf.hibernate.Session session)
           
SessionHolder(net.sf.hibernate.Session session)
           
 
Method Summary
 void addSession(Object key, net.sf.hibernate.Session session)
           
 void addSession(net.sf.hibernate.Session session)
           
 void clear()
          Clear the transactional state of this resource holder.
 boolean containsSession(net.sf.hibernate.Session session)
           
 boolean doesNotHoldNonDefaultSession()
           
 net.sf.hibernate.Session getAnySession()
           
 net.sf.hibernate.FlushMode getPreviousFlushMode()
           
 net.sf.hibernate.Session getSession()
           
 net.sf.hibernate.Session getSession(Object key)
           
 net.sf.hibernate.Transaction getTransaction()
           
 net.sf.hibernate.Session getValidatedSession()
           
 net.sf.hibernate.Session getValidatedSession(Object key)
           
 boolean isEmpty()
           
 net.sf.hibernate.Session removeSession(Object key)
           
 void setPreviousFlushMode(net.sf.hibernate.FlushMode previousFlushMode)
           
 void setTransaction(net.sf.hibernate.Transaction transaction)
           
 
Methods inherited from class org.springframework.transaction.support.ResourceHolderSupport
getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, released, requested, reset, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionHolder

public SessionHolder(net.sf.hibernate.Session session)

SessionHolder

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

getSession

public net.sf.hibernate.Session getSession()

getSession

public net.sf.hibernate.Session getSession(Object key)

getValidatedSession

public net.sf.hibernate.Session getValidatedSession()

getValidatedSession

public net.sf.hibernate.Session getValidatedSession(Object key)

getAnySession

public net.sf.hibernate.Session getAnySession()

addSession

public void addSession(net.sf.hibernate.Session session)

addSession

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

removeSession

public net.sf.hibernate.Session removeSession(Object key)

containsSession

public boolean containsSession(net.sf.hibernate.Session session)

isEmpty

public boolean isEmpty()

doesNotHoldNonDefaultSession

public boolean doesNotHoldNonDefaultSession()

setTransaction

public void setTransaction(net.sf.hibernate.Transaction transaction)

getTransaction

public net.sf.hibernate.Transaction getTransaction()

setPreviousFlushMode

public void setPreviousFlushMode(net.sf.hibernate.FlushMode previousFlushMode)

getPreviousFlushMode

public net.sf.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

The Spring Framework

Copyright © 2002-2007 The Spring Framework.