# File lib/rubyrep/session.rb, line 197
    def connect_database(database)
      if configuration.left == configuration.right and database == :right
        # If both database configurations point to the same database
        # then don't create the database connection twice.
        # Assumes that the left database is always connected before the right one.
        self.right = self.left
      else
        # Connect the database / proxy
        arm_config = configuration.send database
        if arm_config.include? :proxy_host
          drb_url = "druby://#{arm_config[:proxy_host]}:#{arm_config[:proxy_port]}"
          @proxies[database] = DRbObject.new nil, drb_url
        else
          # Create fake proxy
          @proxies[database] = DatabaseProxy.new
        end
        @connections[database] = @proxies[database].create_session arm_config

        send(database).manual_primary_keys = manual_primary_keys(database)
      end
    end