From 85cca718e308779a56dbf302140ce9088fc0727a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 11 Jun 2024 00:11:58 -0700 Subject: Throw an error when changes can't be committed to the database 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. --- src/SemanticScuttle/Service/Tag2Tag.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/SemanticScuttle/Service/Tag2Tag.php') diff --git a/src/SemanticScuttle/Service/Tag2Tag.php b/src/SemanticScuttle/Service/Tag2Tag.php index 9a5d0f2..d404bb5 100644 --- a/src/SemanticScuttle/Service/Tag2Tag.php +++ b/src/SemanticScuttle/Service/Tag2Tag.php @@ -94,7 +94,15 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_DbService ); return false; } - $this->db->sql_transaction('commit'); + + if (!$this->db->sql_transaction('commit')) { + $this->db->sql_transaction('rollback'); + message_die( + GENERAL_ERROR, 'Could not commit attaching tag to tag', + '', __LINE__, __FILE__, $query, $this->db + ); + return false; + } // Update stats and cache $this->update($tag1, $tag2, $relationType, $uId); -- cgit v1.2.3-54-g00ecf