Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

IIS Worker Process and File Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matt MacDonald - 04 Sep 2007 20:41 GMT
Hi all,
 If this isn't the write forum for this question, I appologize, but
it's kind of a mix of ASP.NET and IIS.  Anyway, my question is this.
If an ASP.NET site is writing to a file, does the file get written as
soon as the request is processed or once the IIS Worker Process queues
it up?  For example:

Users 1, 2, and 3 all hit the page that called the file write at the
same time.  Am I left to deal with a file access violation because
users 2 and 3 can't access the file while user 1 is writing to it, or
will all requests get written without incident because the worker
process has to write them all in sequence?

This is more of a precautionary question than a problem I'm having.
Of course, regardless of what's "supposed" to happen I'm still going
to handle any exceptions that arrise, but I figured I should find out
what the ruling is as well.

Thanks,
 Matt
Juan T. Llibre - 04 Sep 2007 21:06 GMT
You should code your page so users write unique file names.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
> Hi all,
>  If this isn't the write forum for this question, I appologize, but
[quoted text clipped - 16 lines]
> Thanks,
>  Matt
George Ter-Saakov - 04 Sep 2007 21:22 GMT
I am not sure what is the question.
That is how file system designed. It's not really supporting simultaneous
access.
Use MS SQL (or any other database) for that.  Or come up with single
threaded "Writer" that will queue up requests to write to file (not really a
good solution).

George.

> Hi all,
>  If this isn't the write forum for this question, I appologize, but
[quoted text clipped - 16 lines]
> Thanks,
>  Matt
Peter Bromberg [C# MVP] - 05 Sep 2007 01:44 GMT
You could definitely end up with file access collisions since IIS is
multithreaded and there could indeed be 3 separate Page class instances all
attempting to write the file with the same name at the same time.  Maybe time
to rethink our logic?
Signature

Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com

> Hi all,
>   If this isn't the write forum for this question, I appologize, but
[quoted text clipped - 16 lines]
> Thanks,
>   Matt
Matt MacDonald - 05 Sep 2007 13:23 GMT
On Sep 4, 8:44 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yohohhoandabottleofrum.com> wrote:
> You could definitely end up with file access collisions since IIS is
> multithreaded and there could indeed be 3 separate Page class instances all
[quoted text clipped - 28 lines]
>
> - Show quoted text -

Well at this point we're still brainstorming.  I figured that was
going to be the answer, but I didn't want to overthink it and invest
additional time and resources if IIS was already set up to prevent
this anyway.  Thanks to all for the responses.
teddysnips@hotmail.com - 05 Sep 2007 16:19 GMT
> On Sep 4, 8:44 pm, Peter Bromberg [C# MVP]
>
[quoted text clipped - 36 lines]
> additional time and resources if IIS was already set up to prevent
> this anyway.  Thanks to all for the responses.- Hide quoted text -

Neat!  This thread has, I think, solved one of my (many) problems.

Edward

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.