DefaultSessionProvider
The SessionProvider for an application that runs its own transactions: the outermost operation on a thread borrows a session from dataSource, binds it to the thread, and gives it back when it returns.
Operations made from inside one another share that session, in a transaction or not, so nesting holds one connection. A level that begins while the one above is still reading a result - in a forEach* block or a ResultConverter - is refused by the driver with CONNECTION_BUSY; a second connection there is taken from the DataSource by hand.
Where a framework owns the transactions, use a provider that finds its session instead.
Parameters
Where connections come from. Not closed by close.
Functions
Runs action on the session for the current context: the transaction's inside a transaction, the enclosing call's inside another execute, and otherwise one obtained for this call alone, whose statements commit as they go. An implementation is expected to share the session across nested calls.