org.apache.ode.daohib

## Class SessionManager

- java.lang.Object
- - org.apache.ode.daohib.SessionManager

-     public class SessionManager
      extends java.lang.Object

  Manages hibernate sessions, and their association with a transaction thread. Uses a ThreadLocal strategy for managing sessions.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `PROP_GUID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SessionManager(java.util.Properties env, javax.sql.DataSource ds, javax.transaction.TransactionManager tx)` Inaccessible constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canJoinForUpdate()` Returns flag which shows whether " where ..
    `static java.sql.Connection` | `getConnection(java.util.Properties props)`
    `org.hibernate.cfg.Configuration` | `getDefaultConfiguration()` Returns a hibernate configuration with hibernate DAO objects added as resources.
    `org.hibernate.Session` | `getSession()` Get the current Hibernate Session.
    `static javax.transaction.TransactionManager` | `getTransactionManager(java.util.Properties props)`
    `static void` | `registerTransactionManager(java.lang.String uuid, javax.transaction.TransactionManager txm)`
    `void` | `shutdown()`

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

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

- - ### Field Detail

    - #### PROP_GUID

          public static final java.lang.String PROP_GUID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SessionManager

          public SessionManager(java.util.Properties env,
                                javax.sql.DataSource ds,
                                javax.transaction.TransactionManager tx)
                         throws org.hibernate.HibernateException

      Inaccessible constructor.
      Throws:
        `org.hibernate.HibernateException`

  - ### Method Detail

    - #### registerTransactionManager

          public static void registerTransactionManager(java.lang.String uuid,
                                                        javax.transaction.TransactionManager txm)

    - #### getSession

          public org.hibernate.Session getSession()

      Get the current Hibernate Session.

    - #### canJoinForUpdate

          public boolean canJoinForUpdate()

      Returns flag which shows whether " where .. join ... for update" kind of queries can be used (supported by currently effective `Dialect`. If it's `false` than sub-query fallback should be invoked instead.
      Returns:
        currently returns false only for `IngresDialect`

    - #### getDefaultConfiguration

          public org.hibernate.cfg.Configuration getDefaultConfiguration()
                                                                  throws org.hibernate.MappingException

      Returns a hibernate configuration with hibernate DAO objects added as resources.
      Returns:
      Throws:
        `org.hibernate.MappingException`

    - #### getTransactionManager

          public static javax.transaction.TransactionManager getTransactionManager(java.util.Properties props)

    - #### getConnection

          public static java.sql.Connection getConnection(java.util.Properties props)
                                                   throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### shutdown

          public void shutdown()