execute

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

Executes the given action within an OctaviusSession, translating any exceptions thrown. 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

org.springframework.dao.DataAccessException

if a database access error occurs or an exception is translated