input-output-hk / mithril

Stake-based threshold multi-signatures protocol
https://mithril.network
Apache License 2.0
115 stars 36 forks source link

Automatic rollback on SQL transactions #1741

Closed Alenar closed 3 weeks ago

Alenar commented 3 weeks ago

Why

Currently the few times that we need to use SQLite transactions we don't handle at all an error in the system, meaning that we don't rollback immediately by rely on the fact that SQLite may rollback the transaction on it's own later.

What

Design a lightweight Transaction system that wrap an SQLite connection and automatically rollback when it goes out of scope if the transaction is still active (an active transaction is a transaction has still yet to be rolled back or committed).

How