| 119 | } |
| 120 | |
| 121 | void db_begin_transaction_(struct db *db, const char *location) |
| 122 | { |
| 123 | bool ok; |
| 124 | if (db->in_transaction) |
| 125 | db_fatal("Already in transaction from %s", db->in_transaction); |
| 126 | |
| 127 | /* No writes yet. */ |
| 128 | db->dirty = false; |
| 129 | |
| 130 | db_prepare_for_changes(db); |
| 131 | ok = db->config->begin_tx_fn(db); |
| 132 | if (!ok) |
| 133 | db_fatal("Failed to start DB transaction: %s", db->error); |
| 134 | |
| 135 | db->in_transaction = location; |
| 136 | } |
| 137 | |
| 138 | bool db_in_transaction(struct db *db) |
| 139 | { |
nothing calls this directly
no test coverage detected