# File lib/stomp_server/queue/activerecord_queue.rb, line 13
  def initialize(configdir, storagedir)
    # Default configuration, use SQLite for simplicity
    db_params = {
      'adapter' => 'sqlite3',
      'database' => "#{configdir}/stompserver_development"
    }
    # Load DB configuration
    db_config = "#{configdir}/database.yml"
    puts "reading from #{db_config}"
    if File.exists? db_config
      db_params.merge! YAML::load(File.open(db_config))
    end

    puts "using #{db_params['database']} DB"

    # Setup activerecord
    ActiveRecord::Base.establish_connection(db_params)
    # Development <TODO> fix this
    ActiveRecord::Base.logger = Logger.new(STDERR)
    ActiveRecord::Base.logger.level = Logger::INFO
    # we need the connection, it can't be done earlier
    ArMessage.reset_column_information
    reload_queues
    @stompid = StompServer::StompId.new
  end