Synchronize query with mutex to resolve thread saftey issue
Synchronize query with mutex to resolve thread saftey issue

Because of the shared active record db connection, we saw errors like the following upon migrating from firefox to chrome

Mysql2::Error: This connection is in use by: #<Thread:0x0000000d5bada8@/usr/local/lib/ruby/2.2.0/webrick/server.rb:283 sleep>

Adding this mutex resolves the issue. Once the app has been upgraded to Rails 5.1, all of this can be removed since database connections are shared there by default (yay!)

concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse