diff options
author | Tom Willemse | 2024-06-11 00:11:58 -0700 |
---|---|---|
committer | Tom Willemse | 2024-06-11 00:11:58 -0700 |
commit | 85cca718e308779a56dbf302140ce9088fc0727a (patch) | |
tree | ac0db2fa23482c6ef5caedd21079bf2f8c9be368 /src/SemanticScuttle/Service/Bookmark.php | |
parent | dec3464bffa14245b2cea076f2aac3a55283230d (diff) | |
download | scuttle-85cca718e308779a56dbf302140ce9088fc0727a.tar.gz scuttle-85cca718e308779a56dbf302140ce9088fc0727a.zip |
Throw an error when changes can't be committed to the databasesqlite-fixes
I was testing and another process had the database open, so it couldn't commit
changes. This wasn't apparent from the UI because it would just silently assume
a commit went fine.
Diffstat (limited to 'src/SemanticScuttle/Service/Bookmark.php')
-rw-r--r-- | src/SemanticScuttle/Service/Bookmark.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark.php b/src/SemanticScuttle/Service/Bookmark.php index f617059..7eb1174 100644 --- a/src/SemanticScuttle/Service/Bookmark.php +++ b/src/SemanticScuttle/Service/Bookmark.php @@ -661,7 +661,13 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService ); } - $this->db->sql_transaction('commit'); + if (!$this->db->sql_transaction('commit')) { + $this->db->sql_transaction('rollback'); + message_die( + GENERAL_ERROR, 'Could not commit bookmark update', + '', __LINE__, __FILE__, $sql, $this->db + ); + } // Everything worked out, so return true. return true; } @@ -1011,7 +1017,13 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService ); } - $this->db->sql_transaction('commit'); + if (!$this->db->sql_transaction('commit')) { + $this->db->sql_transaction('rollback'); + message_die( + GENERAL_ERROR, 'Could not commit deleting votes for bookmark', + '', __LINE__, __FILE__, $query, $this->db + ); + } return true; } |