mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-06 02:51:34 +00:00
Change locking to use postgres syntax, fixes 'must be first statement in transaction' error
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user