Hi Alvin,
thanks for all your help,
I will weight the issues you mention up carefully before making a final
decision.
cheers
martin.
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:ujgYMLlAEHA.3988@tk2msftngp13.phx.gbl...[color=blue][color=green]
> > 1. Is there a maximum number of users who can access a file at any one[/color]
> time,[color=green]
> > I have always been under the impression that even if one user attemps to
> > access a file when another has it open then there will be a problem.[/color]
> Usually, only one user should be writing to the file at any one point in
> time, which is the reason for a lock. In the absence of a lock, multiple
> users will be allowed to write to the file with unpredictable results.
>[color=green]
> > 2. If i have a lock on a file, does it affect other uses who want to[/color][/color]
read[color=blue][color=green]
> > the file or just other sessions that want to write to the file, I guess[/color][/color]
I[color=blue][color=green]
> > can specify the type of lock.[/color]
> It depends on the type of lock. A read lock prevents other users from
> reading the file. A write lock prevents other users from writing to the
> file. A read/write lock is queue.
>[color=green]
> > 3. Is caching the file a good idea and accessing it from memory rather[/color]
> than[color=green]
> > accessing the file on disk all the time. I guess I could alway check[/color][/color]
"does[color=blue][color=green]
> > the value exist in the xml file in the cache" if it does then just read[/color]
> from[color=green]
> > the cache otherwise load the file from disk into the cache.[/color]
> Disk I/O is always very expensive compared to an in-memory access. Weigh
> this carefully against the required memory consumption of the file and[/color]
make[color=blue]
> a best judgement of where the file should reside, that is either in memory
> or on disk.
>
> --
> Regards,
> Alvin Bruney [ASP.NET MVP]
> Got tidbits? Get it here...
>
http://tinyurl.com/3he3b
> "martin" <marc_NO_SPAM_1234@hotmail.com> wrote in message
> news:umzg2BlAEHA.132@TK2MSFTNGP10.phx.gbl...[color=green]
> > Thanks for that Alvin,
> >
> > I have three questions if I may,
> >
> > 1. Is there a maximum number of users who can access a file at any one[/color]
> time,[color=green]
> > I have always been under the impression that even if one user attemps to
> > access a file when another has it open then there will be a problem.
> >
> > 2. If i have a lock on a file, does it affect other uses who want to[/color][/color]
read[color=blue][color=green]
> > the file or just other sessions that want to write to the file, I guess[/color][/color]
I[color=blue][color=green]
> > can specify the type of lock.
> >
> > 3. Is caching the file a good idea and accessing it from memory rather[/color]
> than[color=green]
> > accessing the file on disk all the time. I guess I could alway check[/color][/color]
"does[color=blue][color=green]
> > the value exist in the xml file in the cache" if it does then just read[/color]
> from[color=green]
> > the cache otherwise load the file from disk into the cache.
> >
> > thank for your input.
> >
> > cheers
> >
> > martin.
> >
> > "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
> > news:OFi3q7kAEHA.2576@TK2MSFTNGP11.phx.gbl...[color=darkred]
> > > when you try to write to the resource file, obtain a write lock on the[/color]
> > file.[color=darkred]
> > > This will prevent concurrency issues.
> > >
> > > lock(filereference)
> > > {
> > > anything inside here is protected
> > > }
> > >
> > > --
> > > Regards,
> > > Alvin Bruney [ASP.NET MVP]
> > > Got tidbits? Get it here...
> > >
http://tinyurl.com/3he3b
> > > "martin" <marc_NO_SPAM_1234@hotmail.com> wrote in message
> > > news:eR7O1okAEHA.392@TK2MSFTNGP12.phx.gbl...
> > > > Hi Alvin,
> > > >
> > > > No really resolved it.
> > > >
> > > > can uses an xml file to hold all of my strings for error messages
> > > >
> > > > eg
> > > > <Errors>
> > > > <Key ErrNum="1" value="Must enter a date"/>
> > > > <Key ErrNum="2" value="A fatal error occured -- closing[/color]
> > program"/>[color=darkred]
> > > > <Key ErrNum="3" value="An non fatal error ccured"/>
> > > > </Errors>
> > > >
> > > > however, I am unsure about concurency issues such as a number of[/color][/color][/color]
users[color=blue][color=green][color=darkred]
> > > > accessing the strings at the same time.
> > > > No one will ever write to this xml resources file except me.
> > > > I don't want me writing to it to ever cause an error, and I don't[/color][/color][/color]
want[color=blue][color=green][color=darkred]
> > > > errors to happen when a certain number of users try to read the[/color][/color][/color]
file.[color=blue][color=green][color=darkred]
> > > > I especially don't want to hold these values in a database as I will
> > > retrive
> > > > them often.
> > > >
> > > > I did think about caching the error XML file in memory but it will[/color][/color][/color]
be[color=blue][color=green][color=darkred]
> > > quite
> > > > large.
> > > >
> > > > any ideas would be appreciated.
> > > >
> > > > cheers
> > > >
> > > > martin.
> > > >
> > > >
> > > > "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in[/color][/color][/color]
message[color=blue][color=green][color=darkred]
> > > > news:ODRbyYZAEHA.2768@tk2msftngp13.phx.gbl...
> > > > > Your post went unanswered. Have you resolved this issue?
> > > > >
> > > > > --
> > > > > Regards,
> > > > > Alvin Bruney [ASP.NET MVP]
> > > > > Got tidbits? Get it here...
> > > > >
http://tinyurl.com/3he3b
> > > > > "martin" <marc_NO_SPAM_1234@hotmail.com> wrote in message
> > > > > news:OUntJKAAEHA.620@TK2MSFTNGP11.phx.gbl...
> > > > > > Hi,
> > > > > >
> > > > > > I have noticed that every aspx page that I created (and ascx[/color]
> > file)[color=darkred]
> > > > has
> > > > > an
> > > > > > assosiated resource file aspx.resx.
> > > > > > However what I would like to do is have a single global resource[/color]
> > file[color=darkred]
> > > > for
> > > > > > the site.
> > > > > > The resources in this global resource file will possibly change[/color]
> > quite[color=darkred]
> > > > > often,
> > > > > > there I guess this rules out using web.config as every time[/color]
> > web.config[color=darkred]
> > > > > > alters the application is recompiled, also I am not sure of the
> > > possible
> > > > > > consequences of dynamically changing web.config.
> > > > > >
> > > > > > I was thinking that I could use the resource file of global asax[/color][/color]
> as[color=green]
> > a[color=darkred]
> > > > > global
> > > > > > resource file however I am unsure of whether that is what this[/color][/color]
> file[color=green]
> > is[color=darkred]
> > > > for
> > > > > > or if it is exclusivly for global.asax.
> > > > > >
> > > > > > I guess my only option is an XML file. I have ruled a database[/color][/color][/color]
out[color=blue][color=green]
> > as[color=darkred]
> > > a
> > > > > > means to store global resources.
> > > > > > The main resources that I wish to store are strings to signify[/color]
> > success[color=darkred]
> > > > or
> > > > > > faliure messages on a website.
> > > > > >
> > > > > > cheers
> > > > > >
> > > > > > martin
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]