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 / Web Services / March 2006

Tip: Looking for answers? Try searching our database.

Changing Web.config

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bala Nagarajan - 23 Mar 2006 19:30 GMT
Hello,
     I am building a web service application in which i will have to
implement logging based on user id. My question is where do i store the user
ids? Since the nature of this problem is so dynamic, in the sense the number
of users for whom the logging will be turned on may vary from 0 to N from
point to point. Though i have couple of solutions to adress this problem i
have my concerns about the effiencency. Please advise.

Solution 1: The obvious solution is to store the user id's in the Web.config
as a comma seperated string and before logging check for the user ids and
then perform logging. With this approach i may end up changing the
Web.config in the production machine and i am not aware of its consequences.
I rememeber reading an article that changing the web.config is a not a good
idea though it did not elaborate the reasons and the outcome of it.

Solution 2 : Implement a  polling mechanism to constantly check the database
for the list of users for whom the logging is enabled. The down side of it
is creating connection objects which means consuming resources and also the
polling would continue even if there are no users for logging. Also it is
pretty hard to guess a interval for polling because of the nature of the
problem. if i choose a very small interval there will be an unessecary
overhead and if i choose a large value i will have to wait for that time
untill the logging begins.

I will be really glad if you advise me as to how to go about this.

Thanks
Bala
Steven Cheng[MSFT] - 24 Mar 2006 09:36 GMT
Hi Bala,

Welcome to the ASP.NET newsgroup.

Regarding on the user id storage, IMO, unless the application is a small
application without large user id numbers, we always recommend that store
such information in database. And even we use configuration file (xml file)
to store such info, I suggest you store it in a separate file from
web.config since it is not quite good to frequently read/write web.config
file.  

BTW, if possible, you can also consider load all the IDs into memory (for
caching) in your ASP.NET webservice application(If there is no security
concern on this). Because in ASP.NET 2.0, there comes a new caching
dependeny---- SqlCacheDependency, this can help us cache the data according
to a certain database table(should use sqlserver), we can make the cached
value expired automatically when the certain table has been changed. I
think this maybe helpful in your service:

#Caching in ASP.NET with the SqlCacheDependency Class  
http://msdn2.microsoft.com/en-us/library/ms178604.aspx

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may

learn and benefit from your issue.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

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.