release_lock

This commit is contained in:
Pako Natek 2024-04-01 14:20:25 +02:00
parent 3ac0af24d1
commit bfa59bdcea
1 changed files with 13 additions and 4 deletions

View File

@ -1,8 +1,8 @@
DELIMITER $$
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_assign`(
vUserFk INT,
OUT vCollectionFk INT
)
)
proc:BEGIN
/**
* Comprueba si existen colecciones libres que se ajustan
@ -15,6 +15,15 @@ proc:BEGIN
DECLARE vHasTooMuchCollections BOOL;
DECLARE vLockTime INT DEFAULT 15;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
IF 'collection_assign' IS NOT NULL THEN
DO RELEASE_LOCK('collection_assign');
END IF;
RESIGNAL;
END;
-- Si hay colecciones sin terminar, sale del proceso
CALL collection_get(vUserFk);
@ -84,5 +93,5 @@ proc:BEGIN
WHERE id = vCollectionFk;
DO RELEASE_LOCK('collection_assign');
END$$
DELIMITER ;
END$$
DELIMITER ;