You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please see inline comments.
Code will result in "java.sql.SQLException: Can't call commit when autocommit=true"
deftest():Boolean=
queryEvaluator.transaction {
t => {
t.execute("SELECT 1")
t.execute("SELECT 1")
valeverythingWentSuccessful=falseif(everythingWentSuccessful) {
true
} else {
t.rollback()//causes the Transaction to be rolled back, autoCommit will be set to truefalse
}
} // no exception occurred so query evaluator will call commit on the transaction which yields exception
}
It seems to me the only way to roll back a transaction right now is to
a) raise an error
b) set auto commit to false after calling rollback.
The text was updated successfully, but these errors were encountered:
Please see inline comments.
Code will result in "java.sql.SQLException: Can't call commit when autocommit=true"
It seems to me the only way to roll back a transaction right now is to
a) raise an error
b) set auto commit to false after calling rollback.
The text was updated successfully, but these errors were encountered: