From 5867cf392c12216669e50c6c1d7c68f0b4da488b 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 8f679e0d3..1ff341983 100644 --- a/config/initializers/db_preferences.rb +++ b/config/initializers/db_preferences.rb @@ -11,7 +11,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'