1 package org.sapia.soto.hibernate; 2 3 import net.sf.hibernate.HibernateException; 4 import net.sf.hibernate.Session; 5 6 7 /** 8 * This interface specifies Hibernate session management behavior. It handles registrations 9 * of threads to Hibernate sessions. 10 * 11 * @author Yanick Duchesne 12 * <dl> 13 * <dt><b>Copyright:</b><dd>Copyright © 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt> 14 * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the 15 * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt> 16 * </dl> 17 */ 18 public interface HibernateService { 19 /** 20 * @return a <code>Session</code> 21 * @throws HibernateException if no session could be retrieved for the given thread. 22 */ 23 public Session currentSession() throws HibernateException; 24 25 /** 26 * Internally unregisters the calling thread from its session. 27 */ 28 public void unregister(); 29 } 30