Rollback the [`Transaction`].
(mut self)
| 482 | |
| 483 | /// Rollback the [`Transaction`]. |
| 484 | pub async fn rollback(mut self) -> Result<(), SqlServerError> { |
| 485 | static ROLLBACK_QUERY: &str = "ROLLBACK TRANSACTION"; |
| 486 | // N.B. Mark closed _before_ running the query. This prevents us from |
| 487 | // double closing the transaction if this query itself fails. |
| 488 | self.closed = true; |
| 489 | self.client.simple_query(ROLLBACK_QUERY).await?; |
| 490 | Ok(()) |
| 491 | } |
| 492 | |
| 493 | /// Commit the [`Transaction`]. |
| 494 | pub async fn commit(mut self) -> Result<(), SqlServerError> { |