Ensure read-only transactions are cancelled when complete

This commit is contained in:
Tobie Morgan Hitchcock 2022-08-29 12:29:38 +01:00
parent 8d08c34ddf
commit f22d5d3e51

View file

@ -255,7 +255,10 @@ impl<'a> Executor<'a> {
}; };
// Finalise transaction // Finalise transaction
match &res { match &res {
Ok(_) => self.commit(loc).await, Ok(_) => match stm.writeable() {
true => self.commit(loc).await,
false => self.cancel(loc).await,
},
Err(_) => self.cancel(loc).await, Err(_) => self.cancel(loc).await,
}; };
// Return the result // Return the result