gov.ornl.mercury3.email_utils

## Class HibernateSessionFactory

- java.lang.Object
- - gov.ornl.mercury3.email_utils.HibernateSessionFactory

-     public class HibernateSessionFactory
      extends Object

  Configures and provides access to Hibernate sessions, tied to the current thread of execution. Follows the Thread Local Session pattern, see `http://hibernate.org/42.html`.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `closeSession()` Close the single hibernate session instance.
    `static org.hibernate.Session` | `currentSession()` Returns the ThreadLocal Session instance.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### currentSession

          public static org.hibernate.Session currentSession()
                                                      throws org.hibernate.HibernateException

      Returns the ThreadLocal Session instance. Lazy initialize the `SessionFactory` if needed.
      Returns:
        Session
      Throws:
        `org.hibernate.HibernateException`

    - #### closeSession

          public static void closeSession()
                                   throws org.hibernate.HibernateException

      Close the single hibernate session instance.
      Throws:
        `org.hibernate.HibernateException`

Copyright © 2016. All rights reserved.