diff mbox

[OSSTEST,1/2] Executive database: set isolation level in Perl

Message ID 1480516209-26048-1-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson Nov. 30, 2016, 2:30 p.m. UTC
The Perl was lacking SET TRANSACTION ISOLATION LEVEL SERIALIZABLE,
which is sadly not the default.  Currently that does not matter
because of all the table locking, but we are about to abolish that.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/JobDB/Executive.pm | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index 76f3293..557cee1 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -42,6 +42,9 @@  sub begin_work ($$$) { #method
     my ($jd, $dbh,$tables) = @_;
     
     return if $ENV{'OSSTEST_DEBUG_NOSQLLOCK'};
+
+    $dbh->do("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE");
+
     foreach my $tab (@$tables) {
         $dbh->do("LOCK TABLE $tab IN EXCLUSIVE MODE");
     }