Monday, September 17, 2007

Timers problem on Windows 2003 server

In a SOA solution sometimes we need to set a timer on a web service to manage some tasks.
for example if we have cached data and want to flush it to a database each 30 seconds we can create a timer for this task
the problem is that the timer runs on anonimous identity and cant access the database
the problem exist only on Windows 2003 server, on XP pro it runs with ASPNET user identity
to solve it, create a thread that do that job and sleep for a 30 seconds
Another problem with the thread - it access database or other resource with network service identity and its a very weak account - so if the resource is located on other computer change the application pool identity to other domain user

for help and other learning materials
visit our site: Bina

No comments: