From 4554c0555d33e8cc99fc036b9a692e33d74120ee Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 20 Feb 2015 11:31:39 +1100 Subject: [PATCH] Change locking to use postgres syntax, fixes 'must be first statement in transaction' error --- lib/open_food_network/locking.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/open_food_network/locking.rb b/lib/open_food_network/locking.rb index 8c24256bf3..30dec63b0b 100644 --- a/lib/open_food_network/locking.rb +++ b/lib/open_food_network/locking.rb @@ -2,7 +2,7 @@ module OpenFoodNetwork::Locking # http://rhnh.net/2010/06/30/acts-as-list-will-break-in-production def with_isolation_level_serializable self.transaction do - self.connection.execute("SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE") + self.connection.execute "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE" yield end end