# File lib/rubyrep/connection_extenders/connection_extenders.rb, line 54
    def self.db_connect_without_cache(config)
      if RUBY_PLATFORM =~ /java/
        adapter = config[:adapter]
        
        # As recommended in the activerecord-jdbc-adapter use the jdbc versions
        # of the Adapters. E. g. instead of "postgresql", "jdbcpostgresql".
        adapter = 'jdbc' + adapter unless adapter =~ /^jdbc/

        DummyActiveRecord.establish_connection(config.merge(:adapter => adapter))
      else
        DummyActiveRecord.establish_connection(config)
      end
      connection = DummyActiveRecord.connection
      
      # Delete the database connection from ActiveRecords's 'memory'
      ActiveRecord::Base.connection_handler.connection_pools.delete DummyActiveRecord.name
      
      extender = ""
      if RUBY_PLATFORM =~ /java/
        extender = :jdbc
      elsif ConnectionExtenders.extenders.include? config[:adapter].to_sym
        extender = config[:adapter].to_sym
      else
        raise "No ConnectionExtender available for :#{config[:adapter]}"
      end
      connection.extend ConnectionExtenders.extenders[extender]
      
      # Hack to get Postgres schema support under JRuby to par with the standard
      # ruby version
      if RUBY_PLATFORM =~ /java/ and config[:adapter].to_sym == :postgresql
        connection.extend RR::ConnectionExtenders::PostgreSQLExtender
        connection.initialize_search_path
      end

      replication_module = ReplicationExtenders.extenders[config[:adapter].to_sym]
      connection.extend replication_module if replication_module
      
      connection
    end