org.mycore.backend.hibernate
Class MCRSessionContext
java.lang.Object
org.hibernate.context.ThreadLocalSessionContext
org.mycore.backend.hibernate.MCRSessionContext
- All Implemented Interfaces:
- Serializable, org.hibernate.context.CurrentSessionContext, MCRSessionListener
public class MCRSessionContext
- extends org.hibernate.context.ThreadLocalSessionContext
- implements MCRSessionListener
A CurrentSessionContext implementation which scopes the notion of
current session by the current MCRSession. As the MCRSession can be
used by more than one Thread at a time and Session is not
threadsafe. This implementation allows the first thread of a
MCRSession to keep the Session open for a long conversation.
- Since:
- 2.0
- Version:
- $Revision: 13745 $ $Date: 2008-07-14 15:07:17 +0200 (Mo, 14 Jul 2008) $
- Author:
- Thomas Scheffler (yagee)
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from class org.hibernate.context.ThreadLocalSessionContext |
org.hibernate.context.ThreadLocalSessionContext.CleanupSynch |
| Fields inherited from class org.hibernate.context.ThreadLocalSessionContext |
factory |
|
Constructor Summary |
MCRSessionContext(org.hibernate.engine.SessionFactoryImplementor factory)
|
| Methods inherited from class org.hibernate.context.ThreadLocalSessionContext |
bind, currentSession, getConnectionReleaseMode, getFactory, sessionMap, unbind, wrap |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
firstThread
ThreadLocal<Boolean> firstThread
MCRSessionContext
public MCRSessionContext(org.hibernate.engine.SessionFactoryImplementor factory)
sessionEvent
public void sessionEvent(MCRSessionEvent event)
- Specified by:
sessionEvent in interface MCRSessionListener
buildOrObtainSession
protected org.hibernate.classic.Session buildOrObtainSession()
- Overrides:
buildOrObtainSession in class org.hibernate.context.ThreadLocalSessionContext
isAutoCloseEnabled
protected boolean isAutoCloseEnabled()
- Overrides:
isAutoCloseEnabled in class org.hibernate.context.ThreadLocalSessionContext
isAutoFlushEnabled
protected boolean isAutoFlushEnabled()
- Overrides:
isAutoFlushEnabled in class org.hibernate.context.ThreadLocalSessionContext
buildCleanupSynch
protected org.hibernate.context.ThreadLocalSessionContext.CleanupSynch buildCleanupSynch()
- Overrides:
buildCleanupSynch in class org.hibernate.context.ThreadLocalSessionContext