| 671 | } |
| 672 | |
| 673 | bool SQLiteBatch::TxnCommit() |
| 674 | { |
| 675 | if (!m_database.m_db || !m_txn) return false; |
| 676 | Assert(m_database.HasActiveTxn()); |
| 677 | int res = Assert(m_exec_handler)->Exec(m_database, "COMMIT TRANSACTION"); |
| 678 | if (res != SQLITE_OK) { |
| 679 | LogWarning("SQLiteBatch: Failed to commit the transaction"); |
| 680 | } else { |
| 681 | m_txn = false; |
| 682 | m_database.m_write_semaphore.release(); |
| 683 | } |
| 684 | return res == SQLITE_OK; |
| 685 | } |
| 686 | |
| 687 | bool SQLiteBatch::TxnAbort() |
| 688 | { |