I have started using Kotlin Exposed. One of the early difficulties I got into was that I can’t seem to be able to do a rollback. eg.
transaction {
val result = doSomething()
if (result == false) {
this.rollback()
}
}
In the above code, doSomething() invokes many DAO.new {… }. I want to commit or rollback based on the overall result. However all the DAOs automatically get inserted into the table and the transaction committed. If the question is not entirely clear I could easily contribute a test case.
PS: I tried this.connection.rollback() also.