uk.ac.soton.itinnovation.grid.utils
Class SingletonSessionFactory
java.lang.Object
uk.ac.soton.itinnovation.grid.utils.SingletonSessionFactory
public class SingletonSessionFactory
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingletonSessionFactory
public SingletonSessionFactory()
openThreadLocalSession
public static org.hibernate.classic.Session openThreadLocalSession()
- Create a new session.
A new session is created and stored as a ThreadLocal on the singleton factory.
It can be fetched using factory.getCurrentSession(), and is also returned directly
from this method.
You must call closeThreadLocalSession() when done.
If a session is already open, an error is logged and the old session is closed first.
closeThreadLocalSession
public static void closeThreadLocalSession()
getFactory
public static org.hibernate.SessionFactory getFactory()
close
public static void close()
getOpenSessions
public static String[] getOpenSessions()
checkNoSessionForCurrentThread
public static void checkNoSessionForCurrentThread(String reason)
- Debugging check. Only useful when the system property debug.sessions is set.
- Parameters:
reason - if a session is only, throw this error message
Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.