with Session
Executes a block with the active session, returning a Result.
Return
Result.success with the block's return value, or Result.failure if no session is active or the block throws an exception.
Parameters
block
The operation to perform with the session handle.