From ca2885dce0323e9246fc088e967aa9272298605d Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Fri, 18 Feb 2022 10:45:23 +0000 Subject: [PATCH] =?UTF-8?q?Fixes=20#3969=20-=20Frequent=20=E2=80=9CLost=20?= =?UTF-8?q?connection=20to=20MySQL=20server=20during=20query=E2=80=9D=20er?= =?UTF-8?q?rors=20resulting=20in=20client-side=20Error=20500.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/db_preferences.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/db_preferences.rb b/config/initializers/db_preferences.rb index 265b0d552..26aeccf0a 100644 --- a/config/initializers/db_preferences.rb +++ b/config/initializers/db_preferences.rb @@ -10,7 +10,7 @@ when 'mysql2' # Because of missing ticket updates in high load environments # we changed the transaction isolation level equally to postgres # to READ COMMITTED which fixed the problem entirely #3877 - ActiveRecord::ConnectionAdapters::Mysql2Adapter.set_callback :checkout, :before do |conn| + ActiveRecord::ConnectionAdapters::Mysql2Adapter.set_callback :checkout, :after do |conn| conn.execute('SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED') end when 'postgresql'