I've found weird transaction behaviour on MYSQL. h...
# exposed
t
I've found weird transaction behaviour on MYSQL. having
Copy code
object TransactionTestTable: LongIdTable(){
    val foo = integer("foo").check { it greater 0 }
}
when I do
Copy code
newSuspendedTransaction {
    TransactionTestTable.insert { it[foo] = 1 }
    throw IllegalStateException("FAIL")
}
the transaction performs a rollback correctly and nothing gets inserted into the table but when I do
Copy code
newSuspendedTransaction {
    TransactionTestTable.insert { it[foo] = 1 }
    TransactionTestTable.insert { it[foo] = 0 }
}
the transaction still fails, but the first value gets inserted in the database. Is this intentional or a bug?
b
I have exactly the same problem. It seems that
newSuspendedTransaction
always commits at end and don't uses the parent transaction.
here is a link to the issue
problem was
useLocalTransactionState
set to
true
when disabled, this problem dissapeared
👍 1
b
and where can I find this property in exposed?
t
you'd have to set it not in exposed but in your connector
if you use hikari they expose it in their configuration as well