Interface Stage.StatelessSession

All Superinterfaces:
Stage.Closeable, Stage.QueryProducer
Enclosing interface:
Stage

public static interface Stage.StatelessSession extends Stage.QueryProducer, Stage.Closeable
A non-blocking counterpart to the Hibernate StatelessSession interface, which provides a command-oriented API for performing bulk operations against a database.

A stateless session does not implement a first-level cache nor interact with any second-level cache, nor does it implement transactional write-behind or automatic dirty checking, nor do operations cascade to associated instances. Changes to many to many associations and element collections may not be made persistent in a stateless session. Operations performed via a stateless session bypass Hibernate's event model and interceptors.

For certain kinds of work, a stateless session may perform slightly better than a stateful session.

In particular, for a session which loads many entities, use of a StatelessSession alleviates the need to call:

Stateless sessions are vulnerable to data aliasing effects, due to the lack of a first-level cache.

See Also: