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
|
// prepared statement
|
||||||
$db = $this->em->getConnection();
|
$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
|
$delete_stmt = $db->prepare('DELETE FROM warranty_serial_queue
|
||||||
WHERE id = :id');
|
WHERE id = :id');
|
||||||
|
|
||||||
$res = $delete_stmt->execute([
|
$res = $delete_stmt->execute([
|
||||||
':id' => $id,
|
':id' => $id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$db->exec('UNLOCK TABLES;');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setOutputInfo($filename, $file_id, $has_error, $error_message, $entries, $orig_filename)
|
protected function setOutputInfo($filename, $file_id, $has_error, $error_message, $entries, $orig_filename)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue