Top Description Methods
org.hibernate.context.spi

public Interface CurrentSessionContext

extends Serializable
Known Direct Implementers
org.hibernate.context.spi.AbstractCurrentSessionContext
Imports
java.io.Serializable, org.hibernate.HibernateException, .Session

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
()

Deprecated as a consequence of Session being deprecated.
Retrieve the current session according to the scoping defined by this implementation.

Method Detail

currentSessionback to summary
public Session currentSession() throws HibernateException

Deprecated

as a consequence of Session being deprecated. See corresponding docs for further information.

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.