Class: ActiveRecord::ConnectionAdapters::ConnectionPool

Inherits:
Object
  • Object
show all
Defined in:
lib/gb_dispatch/active_record_patch.rb

Instance Method Summary collapse

Instance Method Details

#force_new_connectionObject



5
6
7
8
9
10
11
12
13
# File 'lib/gb_dispatch/active_record_patch.rb', line 5

def force_new_connection
  old_lock = @lock_thread
  @lock_thread = nil
  with_connection do |conn|
    yield conn
  end
ensure
  @lock_thread = old_lock
end