```release = { clientSession, case -> ...
# arrow
p
Copy code
release = { clientSession, case ->
            val exit =
                when (case) {
                    ExitCase.Completed -> IO { clientSession.commitTransaction().awaitFirstOrNull() }.handleErrorWith { IO { logError() } }
                    else -> IO { clientSession.abortTransaction().awaitFirstOrNull() }
                }
            exit.effectMap { clientSession.close() }     
        }