From b4b6b47a9caf3e89e7abbedfa4b18f162c10d04a Mon Sep 17 00:00:00 2001 From: guillermo Date: Thu, 14 Mar 2024 07:53:24 +0100 Subject: [PATCH] hotfix: itemProposal added transaction --- db/routines/vn/procedures/itemProposal.sql | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/db/routines/vn/procedures/itemProposal.sql b/db/routines/vn/procedures/itemProposal.sql index eb8a7ab33..0dc04124d 100644 --- a/db/routines/vn/procedures/itemProposal.sql +++ b/db/routines/vn/procedures/itemProposal.sql @@ -18,12 +18,19 @@ BEGIN DECLARE vCalcFk INT; DECLARE vTypeFk INT; DECLARE vPriority INT DEFAULT 1; + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + ROLLBACK; + RESIGNAL; + END; SELECT warehouseFk, shipped INTO vWarehouseFk, vShipped FROM ticket WHERE id = vTicketFk; + START TRANSACTION; + CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vShipped); WITH itemTags AS ( @@ -92,5 +99,6 @@ BEGIN match7 DESC, (i.tag8 = its.tag8) DESC, match8 DESC; + COMMIT; END$$ DELIMITER ;