org.nanocontainer.persistence.hibernate
Class FailoverSessionDelegator
java.lang.Object
org.nanocontainer.persistence.hibernate.SessionDelegator
org.nanocontainer.persistence.hibernate.FailoverSessionDelegator
- All Implemented Interfaces:
- Serializable, org.hibernate.Session
public class FailoverSessionDelegator
- extends SessionDelegator
Session delegator with failover behaviour in case of hibernate exception. Old session is disposed
and new one is obtained transparently. Session creation is done lazily.
- Version:
- $Revision: 2043 $
- Author:
- Jose Peleteiro
- See Also:
- Serialized Form
| Methods inherited from class org.nanocontainer.persistence.hibernate.SessionDelegator |
beginTransaction, cancelQuery, clear, connection, contains, createCriteria, createCriteria, createCriteria, createCriteria, createFilter, createQuery, createSQLQuery, delete, disableFilter, disconnect, enableFilter, evict, flush, get, get, get, get, getCacheMode, getCurrentLockMode, getEnabledFilter, getEntityMode, getEntityName, getFlushMode, getIdentifier, getNamedQuery, getSession, getStatistics, handleException, isConnected, isDirty, isOpen, load, load, load, load, load, lock, lock, merge, merge, persist, persist, reconnect, reconnect, refresh, refresh, replicate, replicate, save, save, save, save, saveOrUpdate, saveOrUpdate, setCacheMode, setFlushMode, update, update, update, update |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FailoverSessionDelegator
public FailoverSessionDelegator(org.hibernate.SessionFactory sessionFactory)
- Parameters:
sessionFactory - session factory to obtain session from
FailoverSessionDelegator
public FailoverSessionDelegator(org.hibernate.SessionFactory sessionFactory,
ExceptionHandler exceptionHandler)
- Parameters:
sessionFactory - session factory to obtain session fromexceptionHandler - Exception handler component to use with created session
FailoverSessionDelegator
public FailoverSessionDelegator(org.hibernate.SessionFactory sessionFactory,
org.hibernate.Interceptor interceptor)
- Parameters:
sessionFactory - sessionf actory to obtain session frominterceptor - interceptor to use with created session
FailoverSessionDelegator
public FailoverSessionDelegator(org.hibernate.SessionFactory sessionFactory,
org.hibernate.Interceptor interceptor,
ExceptionHandler exceptionHandler)
- Parameters:
sessionFactory - sessionf actory to obtain session frominterceptor - interceptor to use with created sessionexceptionHandler - Exception handler component to use with created session
getSessionFactory
public org.hibernate.SessionFactory getSessionFactory()
- Specified by:
getSessionFactory in interface org.hibernate.Session- Overrides:
getSessionFactory in class SessionDelegator
getDelegatedSession
public org.hibernate.Session getDelegatedSession()
- Obtain hibernate session in lazy way.
- Specified by:
getDelegatedSession in class SessionDelegator
close
public Connection close()
throws org.hibernate.HibernateException
- Specified by:
close in interface org.hibernate.Session- Overrides:
close in class SessionDelegator
- Throws:
org.hibernate.HibernateException
invalidateDelegatedSession
public void invalidateDelegatedSession()
throws org.hibernate.HibernateException
- Description copied from class:
SessionDelegator
- Perform actions to dispose "burned" session properly.
- Specified by:
invalidateDelegatedSession in class SessionDelegator
- Throws:
org.hibernate.HibernateException
getInterceptor
public org.hibernate.Interceptor getInterceptor()
setInterceptor
public void setInterceptor(org.hibernate.Interceptor interceptor)
Copyright 2003-2003-2006 Codehaus. All Rights Reserved.