/// <summary>
        /// Inserts a list of host ids into the database.
        /// </summary>
        /// <param name="context">Web service request context.</param>
        /// <param name="hostIds">Id for hosts to insert.</param>
        /// <param name="hostUsage">How user selected hosts should be used.</param>
        public static void AddUserSelectedHosts(WebServiceContext context,
                                                List <Int32> hostIds,
                                                UserSelectedTaxonUsage hostUsage)
        {
            DataColumn column;
            DataRow    row;
            DataTable  hostTable;

            if (hostIds.IsNotEmpty())
            {
                // Delete all hosts that belong to this request from the "temporary" tables.
                // This is done to avoid problem with restarts of the webservice.
                DeleteUserSelectedHosts(context);

                // Insert the new list of hosts.
                hostTable = new DataTable(UserSelectedHostData.TABLE_NAME);
                column    = new DataColumn(UserSelectedHostData.REQUEST_ID, typeof(Int32));
                hostTable.Columns.Add(column);
                column = new DataColumn(UserSelectedHostData.HOST_ID, typeof(Int32));
                hostTable.Columns.Add(column);
                column = new DataColumn(UserSelectedHostData.HOST_USAGE, typeof(String));
                hostTable.Columns.Add(column);
                foreach (Int32 hostId in hostIds)
                {
                    row    = hostTable.NewRow();
                    row[0] = context.RequestId;
                    row[1] = hostId;
                    row[2] = hostUsage.ToString();
                    hostTable.Rows.Add(row);
                }

                DataServer.AddUserSelectedHosts(context, hostTable);
            }
        }