mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 16:29:20 +08:00
parent
a7479488b8
commit
1e29cf4a0f
@ -167,8 +167,9 @@ impl<'conn> Transaction<'conn> {
|
||||
}
|
||||
|
||||
fn commit_(&mut self) -> Result<()> {
|
||||
self.conn.execute_batch("COMMIT")?;
|
||||
self.committed = true;
|
||||
self.conn.execute_batch("COMMIT")
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// A convenience method which consumes and rolls back a transaction.
|
||||
@ -177,8 +178,9 @@ impl<'conn> Transaction<'conn> {
|
||||
}
|
||||
|
||||
fn rollback_(&mut self) -> Result<()> {
|
||||
self.conn.execute_batch("ROLLBACK")?;
|
||||
self.committed = true;
|
||||
self.conn.execute_batch("ROLLBACK")
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Consumes the transaction, committing or rolling back according to the current setting
|
||||
@ -277,9 +279,10 @@ impl<'conn> Savepoint<'conn> {
|
||||
}
|
||||
|
||||
fn commit_(&mut self) -> Result<()> {
|
||||
self.committed = true;
|
||||
self.conn
|
||||
.execute_batch(&format!("RELEASE {}", self.name))
|
||||
.execute_batch(&format!("RELEASE {}", self.name))?;
|
||||
self.committed = true;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// A convenience method which rolls back a savepoint.
|
||||
|
Loading…
Reference in New Issue
Block a user