Hi everyone.
I've created an ASP.NET web site which uses a .NET assembly to read/write operations using an odbc driver. When a connection to the odbc database is made locking files are created, when the connection is closed those files are removed.
I tried the web site using VS2005 and it worked fine. Then I published it in IIS 5.1 (WIn XP SP2) but it didn't work. I thought because write permissions on the folder of the database. So I decided to impersonate, first I tried impersonation in the virtual directory and then programatically . In both cases I used a local administrator account. The problem is that even though the current WindowsPrincipa l shows that the administrator account is being used by the assembly, the database files are locked by ASPNET anyway. I checked this using a handle utility which shows which process and users are locking a file. Becuase of that (I guess) the application is not working. Any operation against the odbc driver fails.
I've noticed that when I used VS2005 to test the web site, and also a windows application using the same assembly, the odbc database worker process is loadded when I call the Open method of the odbc connection. The process ends when the Close method is called. This is expected and in this case wevrything works fine. However, when I used the published web site, the worker process is loaded just an instant and then it is finished automatically without any reason . That's why after that point any statemente against the odbc driver will fail with the error "No valid application is running"
Any ideas about why this is happening? Why the locking user on the files is not the impersonated user? why the odbc database worker process lasts just an instant after the connection is Open? Is this becuase ASP.NET does not have permission to start a process?
Thanks! Any help would be appreciated
I've created an ASP.NET web site which uses a .NET assembly to read/write operations using an odbc driver. When a connection to the odbc database is made locking files are created, when the connection is closed those files are removed.
I tried the web site using VS2005 and it worked fine. Then I published it in IIS 5.1 (WIn XP SP2) but it didn't work. I thought because write permissions on the folder of the database. So I decided to impersonate, first I tried impersonation in the virtual directory and then programatically . In both cases I used a local administrator account. The problem is that even though the current WindowsPrincipa l shows that the administrator account is being used by the assembly, the database files are locked by ASPNET anyway. I checked this using a handle utility which shows which process and users are locking a file. Becuase of that (I guess) the application is not working. Any operation against the odbc driver fails.
I've noticed that when I used VS2005 to test the web site, and also a windows application using the same assembly, the odbc database worker process is loadded when I call the Open method of the odbc connection. The process ends when the Close method is called. This is expected and in this case wevrything works fine. However, when I used the published web site, the worker process is loaded just an instant and then it is finished automatically without any reason . That's why after that point any statemente against the odbc driver will fail with the error "No valid application is running"
Any ideas about why this is happening? Why the locking user on the files is not the impersonated user? why the odbc database worker process lasts just an instant after the connection is Open? Is this becuase ASP.NET does not have permission to start a process?
Thanks! Any help would be appreciated
Comment