Top Description Methods
org.hibernate.context

public Interface CurrentSessionContext

extends Serializable
Known Direct Implementers
org.hibernate.context.JTASessionContext, org.hibernate.context.ManagedSessionContext, org.hibernate.context.ThreadLocalSessionContext
Imports
org.hibernate.HibernateException, java.io.Serializable

Defines the contract for implementations which know how to scope the notion of a current session.

Implementations should adhere to the following:

Implementors should be aware that they are also fully responsible for cleanup of any generated current-sessions.

Note that there will be exactly one instance of the configured CurrentSessionContext implementation per org.hibernate.SessionFactory.

Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public Session

Returns:

The current session.
currentSession
()

Retrieve the current session according to the scoping defined by this implementation.

Method Detail

currentSessionback to summary
public Session currentSession() throws HibernateException

Retrieve the current session according to the scoping defined by this implementation.

Returns:Session

The current session.

Exceptions
HibernateException:
Typically indicates an issue locating or creating the current session.