After creating the Full-Text Catalogs and Indexes on the SQL Server, I ran a script to populate the indexes. Since population takes a while, especially if the database is large, I decided to check on the status periodically via the FullTextCatalogProperty function in SQL Server.
One of the properties returned by the function is the PopulationStatus property which has one of the following values:
0 = Idle
1 = Full population in progress
2 = Paused
3 = Throttled
4 = Recovering
5 = Shutdown
6 = Incremental population in progress
7 = Building index
8 = Disk is full. Paused.
9 = Change tracking
In my case it was showing 1, meaning the population was in progress. After about a couple of hours it was still showing 1 and just stayed there. When I checked the ItemCount property returned by the same function, it was showing 0, meaning no items had been indexed so far.These were clear signs that the data population process was stuck.
I looked at the scripts and the tables and the catalogs and indexes, but didnt find anything amiss. I then checked the logs in the SQL Install folder and noticed the following error related to Full-Text Search:
"No Mapping between account names and security id's were done"
I had no idea where this error was coming from and it took me some time before I hit upon the idea of checking the Full-Text Search Windows Service. It turned out that the Service was running under a user account Admin123 that no longer existed on the machine. I changed the Service to run under the Local System Account and everything started working!!!
Showing posts with label Windows Service. Show all posts
Showing posts with label Windows Service. Show all posts
11/14/10
10/31/10
System.Threading.Timer
I have a data population task inside a windows service that needs to start on a certain date and repeat periodically at a specified interval. The start date and the repeat interval can be specified through a xml config file.
I decided to use the Timer class in the System.Threading namespace. It has a number of constructor overloads and the following is the one I used :
public Timer(TimerCallback callback, Object state, TimeSpan dueTime, TimeSpan period);
where:
callback -> The method that performs the task.
It must match the signature of the System.Threading.TimerCallback delegate type that has the following signature:
delegate void TimerCallback(Object state)
state -> data that you can pass to the callback method each time it is invoked.
dueTime - > the amount of time the CLR needs to wait before calling the callback method the first time.
period -> the repeat interval
The advantage of using this Timer class is that the callback method is called by a CLR thread pool thread. The Thread Pool assigns one thread from the pool for all Timer instances. This thread keeps track of all the timers and calls them at their due time.
(reference : CLR via C# - Jeffrey Richter)
I decided to use the Timer class in the System.Threading namespace. It has a number of constructor overloads and the following is the one I used :
public Timer(TimerCallback callback, Object state, TimeSpan dueTime, TimeSpan period);
where:
callback -> The method that performs the task.
It must match the signature of the System.Threading.TimerCallback delegate type that has the following signature:
delegate void TimerCallback(Object state)
state -> data that you can pass to the callback method each time it is invoked.
dueTime - > the amount of time the CLR needs to wait before calling the callback method the first time.
period -> the repeat interval
The advantage of using this Timer class is that the callback method is called by a CLR thread pool thread. The Thread Pool assigns one thread from the pool for all Timer instances. This thread keeps track of all the timers and calls them at their due time.
(reference : CLR via C# - Jeffrey Richter)
Labels:
CLR Thread Pool,
MultiThreading,
Timer,
Windows Service
Subscribe to:
Posts (Atom)