Skip to content

Automatically handle nested transactions

We start to have a lot of code like

    std::unique_ptr<sqlite::Transaction> t;
    if ( sqlite::Transaction::transactionInProgress() == false )
        t = m_ml->getConn()->newTransaction();
    // Do stuff
    if ( t != nullptr )
        t->commit();

It would be easier and less bug prone to do this automatically when instantiating the transaction, and either have a no-op transaction implementation, or be fancy and have a SAVEPOINT / RELEASE transactio instead of BEGIN / COMMIT

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information