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 4cb5a7776b
commit ca2885dce0

View file

@ -10,7 +10,7 @@ when 'mysql2'
# Because of missing ticket updates in high load environments # Because of missing ticket updates in high load environments
# we changed the transaction isolation level equally to postgres # we changed the transaction isolation level equally to postgres
# to READ COMMITTED which fixed the problem entirely #3877 # 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') conn.execute('SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED')
end end
when 'postgresql' when 'postgresql'