From f8a6721703bad8881a993e490a8987891290ec5e Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Mon, 19 Oct 2015 17:31:26 -0400 Subject: [PATCH] Increase transaction isolation level for track scheduling and moving --- airtime_mvc/application/models/Scheduler.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index 51b964589..e5ecd707c 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -955,6 +955,10 @@ class Application_Model_Scheduler $this->con->beginTransaction(); try { + //Increase the transaction isolation level to prevent two concurrent requests from potentially resulting + //in tracks scheduled at the same time. + $this->con->exec("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"); + $this->validateMediaItems($mediaItems); //Check for missing files, etc. $this->validateRequest($scheduleItems, true); @@ -1005,6 +1009,9 @@ class Application_Model_Scheduler //$this->con->useDebug(true); try { + //Increase the transaction isolation level to prevent two concurrent requests from potentially resulting + //in tracks scheduled at the same time. + $this->con->exec("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"); $this->validateItemMove($selectedItems, $afterItems[0]); $this->validateRequest($selectedItems);