org.springframework.orm.hibernate
Class SessionHolder

java.lang.Object
  extended byorg.springframework.transaction.support.ResourceHolderSupport
      extended byorg.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, Session session)
           
SessionHolder(Session session)
           
 
Method Summary
 void addSession(Object key, Session session)
           
 void clear()
          Clear the transaction state of this resource holder.
 boolean containsSession(Session session)
           
 boolean doesNotHoldNonDefaultSession()
           
 Session getAnySession()
           
 FlushMode getPreviousFlushMode()
           
 Session getSession()
           
 Session getSession(Object key)
           
 Transaction getTransaction()
           
 boolean isEmpty()
           
 Session removeSession(Object key)
           
 void setPreviousFlushMode(FlushMode previousFlushMode)
           
 void setTransaction(Transaction transaction)
           
 
Methods inherited from class org.springframework.transaction.support.ResourceHolderSupport
getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isRollbackOnly, isSynchronizedWithTransaction, 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(Session session)

SessionHolder

public SessionHolder(Object key,
                     Session session)
Method Detail

getSession

public Session getSession()

getSession

public Session getSession(Object key)

getAnySession

public Session getAnySession()

addSession

public void addSession(Object key,
                       Session session)

removeSession

public Session removeSession(Object key)

containsSession

public boolean containsSession(Session session)

isEmpty

public boolean isEmpty()

doesNotHoldNonDefaultSession

public boolean doesNotHoldNonDefaultSession()

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 transaction state of this resource holder.

Overrides:
clear in class ResourceHolderSupport


Copyright (C) 2003-2004 The Spring Framework Project.