Get a Hibernate Session, either from the current transaction or a new one. The latter is only allowed if "allowCreate" is true.
In general, it is recommended to use HibernateTemplate, either with the provided convenience operations or with a custom HibernateCallback that provides you with a Session to work on. HibernateTemplate will care for all resource management and for proper exception conversion.
|DataAccessResourceFailureException||If the Session couldn't be created|
|InvalidOperationException||if no thread-bound Session found and allowCreate false|