execute

fun <T> execute(action: OctaviusSessionOperations.() -> T): T

Executes the given action within an OctaviusSession. The session is passed as the receiver of action, so its operations are available directly. Connection management and transaction synchronization are handled automatically.

Return

the result of the action

Parameters

action

the action to execute, with the session as its receiver

Throws

for a failure of the driver's, including a connection the data source would not hand over, which is an InitializationException. Anything else action throws leaves as it was thrown.