SessionProvider
Answers the only question the client cannot answer for itself: which session does this operation run on.
The client is a pooled facade over a driver that is session-per-connection, and this interface is where those two meet. Everything above it - queries, builders, transaction plans - is written against execute and never obtains a session of its own, which is what lets the same query code run standalone on a connection pool and under a transaction manager that owns the connection itself.
Implementations decide what "the current session" means. The default one binds it to the thread; one backed by Spring finds it on whatever the surrounding @Transactional bound.
Inheritors
Functions
Runs block with a transaction open, committing when it returns and rolling back when it throws.