Fixes #3969 - Frequent “Lost connection to MySQL server during query” errors resulting in client-side Error 500.

This commit is contained in:
Rolf Schmidt 2022-02-18 10:45:23 +00:00
parent 29a3b5fd54
commit 5867cf392c

View file

@ -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'