Ensure read-only transactions are cancelled when complete
This commit is contained in:
parent
8d08c34ddf
commit
f22d5d3e51
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue