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