473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Changing Web.config

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

Mar 23 '06 #1
1 1291
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.

Mar 24 '06 #2

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

Similar topics

0
by: syed_saqib_ali | last post by:
Please take a look at and run the code snippet shown below. It creates a canvas with vertical & Horizontal scroll-bars. If you shrink the window to smaller than the area of the canvas, the...
1
by: Samridhi Kumar Shukla | last post by:
I am facing technical difficulti in using server connection control because we cannot change the path once fixed .. one way is to edit the code of the form generated code but though it allow to...
3
by: Chris | last post by:
If I change the web.config file in my application on Server A, and want to push the changes to Server B, do I need to rebuild the project and copy the new dll, or do I simply need to copy over the...
2
by: John Dalberg | last post by:
The below html validates correctly on w3.org's html validator when the file has an html extension. When the same file gets an aspx extension, I get the error below from the validator. This tells me...
5
by: pb | last post by:
Do anyone know how to change the .aspx extension to something else, say ..sssx, for all or part of a ASP.NET 2.0 site? I recall a Microsoft article on this some time ago, but I cannot locate it.
4
by: Srini | last post by:
I noticed that ASP.Net caches the web.config and does not reread it unless it is changed. But if you change it, it restarts the app and even session variables are cleared (Am I correct ?). I used...
5
by: Sridhar | last post by:
Hi, I have created a project which contains classes to read the data from the database. This project has an App.Config file which contains the SqlConnection String. when this code is called from...
0
by: VB Programmer | last post by:
ASP.NET 2.0 site... Using web deployment project. Allowed web.config to be updateable. Settings not only in web.config but also in appSettings.config and connectionStrings.config. Question:...
7
by: Larry Neylon | last post by:
Hi there, We are in the process of implementing Membership and Role Management and have a problem with the connection strings in our web.config. We currently have a system that on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.