diff --git a/lib/src/dbs/executor.rs b/lib/src/dbs/executor.rs index dbca50ea..bb0afbc5 100644 --- a/lib/src/dbs/executor.rs +++ b/lib/src/dbs/executor.rs @@ -255,7 +255,10 @@ impl<'a> Executor<'a> { }; // Finalise transaction 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, }; // Return the result