Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > New thread - not same credentials?

Reply
Thread Tools

New thread - not same credentials?

 
 
Casper Hornstrup
Guest
Posts: n/a
 
      11-26-2003
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


 
Reply With Quote
 
 
 
 
Alvin Bruney
Guest
Posts: n/a
 
      11-30-2003
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" <(E-Mail Removed)> wrote in message
news:uiRBHu$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on multi-thread execute the same method of same classinstance QQ Java 6 03-28-2008 02:56 PM
Start a thread with the same credentials as the parent thread =?Utf-8?B?cGxleDRy?= ASP .Net 0 11-13-2007 08:11 PM
Problem starting a new thread from another thread tzhong98-101@yahoo.com Perl Misc 3 08-03-2006 03:15 AM
creating a new thread extending thread class Aditi Java 2 06-24-2005 03:29 PM
Terminating program run from thread (not just the thread) Jeffrey Barish Python 0 05-28-2004 02:02 AM



Advertisments