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 ;