Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7579: ticket_7579_against_6538.diff

File ticket_7579_against_6538.diff, 1.3 kB (added by wilson, 1 year ago)

Patch against rev 6538 of trunk

  • activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb

    old new  
    8989       
    9090      # Clears the cache which maps classes  
    9191      def clear_reloadable_connections! 
    92         @@active_connections.each do |name, conn| 
    93           if conn.requires_reloading? 
    94             conn.disconnect! 
    95             @@active_connections.delete(name) 
     92        if @@allow_concurrency 
     93          @@active_connections.each do |thread_id, conns| 
     94            conns.each do |name, conn| 
     95              if conn.requires_reloading? 
     96                conn.disconnect! 
     97                @@active_connections[thread_id].delete(name) 
     98              end 
     99            end 
    96100          end 
     101        else 
     102          @@active_connections.each do |name, conn| 
     103            if conn.requires_reloading? 
     104              conn.disconnect! 
     105              @@active_connections.delete(name) 
     106            end 
     107          end 
    97108        end 
    98109      end 
    99  
     110       
    100111      # Verify active connections. 
    101112      def verify_active_connections! #:nodoc: 
    102113        if @@allow_concurrency