Add locking and unlocking for warranty serial queue table when deleting an entry. #708
This commit is contained in:
parent
21231358d6
commit
815c25a894
1 changed files with 6 additions and 0 deletions
|
|
@ -392,12 +392,18 @@ class LoadWarrantySerialCommand extends Command
|
|||
{
|
||||
// prepared statement
|
||||
$db = $this->em->getConnection();
|
||||
|
||||
// lock the warranty serial queue table
|
||||
$db->exec('LOCK TABLES warranty_serial_queue WRITE;');
|
||||
|
||||
$delete_stmt = $db->prepare('DELETE FROM warranty_serial_queue
|
||||
WHERE id = :id');
|
||||
|
||||
$res = $delete_stmt->execute([
|
||||
':id' => $id,
|
||||
]);
|
||||
|
||||
$db->exec('UNLOCK TABLES;');
|
||||
}
|
||||
|
||||
protected function setOutputInfo($filename, $file_id, $has_error, $error_message, $entries, $orig_filename)
|
||||
|
|
|
|||
Loading…
Reference in a new issue