473,473 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

New thread - not same credentials?

I upload an excel file, save it on the webserver and import the contents to
an MSSQL database.
I use the MS JET OleDb provider to read from the excel file. If I do this
during the HTTP
request this works fine. If however I let another thread (from a pool I've
created when
the ASP.NET application was first started) do the job, the OleDb provider
returns E_FAIL.
If I give Everyone full rights on the file, it works when the new thread is
used.
This is on a Windows Server 2003 btw. When the file is uploaded, it receives
Special (Allow List folder / Read data, Allow Delete) for NETWORK SERVICE.
The ASPNET user is not in the ACL. How can I solve this problem?

Casper
Nov 18 '05 #1
1 1034
It should not be working for you at all. Well at least, that's the mind set
you should have because you've violated a major thread law here. Threads are
not allowed to tamper with objects belonging to the main thread. The main
thread owns the http object, your worker thread does not. Results will
typically be flakey, working sometimes, failing at others because of the way
requests are scheduled underneath the hood.

To work around this, you can try passing a reference to the http object to
the worker thread. This will allow the worker thread to safely modify the
object and guarantee consitency. So from the pool of threads you created,
let one of the parameters be a httpcontext object.

--
Regards,
Alvin Bruney
Got Tidbits? Get it here
www.networkip.net/tidbits
"Casper Hornstrup" <ch@csite.com> wrote in message
news:ui**************@tk2msftngp13.phx.gbl...
I upload an excel file, save it on the webserver and import the contents to an MSSQL database.
I use the MS JET OleDb provider to read from the excel file. If I do this
during the HTTP
request this works fine. If however I let another thread (from a pool I've
created when
the ASP.NET application was first started) do the job, the OleDb provider
returns E_FAIL.
If I give Everyone full rights on the file, it works when the new thread is used.
This is on a Windows Server 2003 btw. When the file is uploaded, it receives Special (Allow List folder / Read data, Allow Delete) for NETWORK SERVICE.
The ASPNET user is not in the ACL. How can I solve this problem?

Casper

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Makarand Keer | last post by:
Hi all Gurus I have asp.net application where I am creating background process using Threading. My threading involves invoking method which in turn gets some data from SQL server using Windows...
0
by: Jorge Filipe Barreiros | last post by:
I have a .net web application that calls a .net web service with the credentials of the windows logged user on the web application using impersonate. Everything's ok here. There's a very big...
5
by: Brian | last post by:
I have an file based asp.net application the creates a thread to do some background printing. It works fine but when the application is deployed on a web server, the following error occurs in the...
0
by: =?Utf-8?B?cGxleDRy?= | last post by:
How can I start a new thread that has the same security credentials as the parent thread. I am working in and asp.net application where I want to spawn a new thread to get some data from a remote...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.