Using static collection in a WebService

Joined
Dec 18, 2007
Messages
1
Reaction score
0
Hello,

I have a few clients accessing a WebService. Every client first calls a LoginWS method, to which it sends as a parameter a string value, used for creating a DB connection string for each user. It is currently saved in a Dictionary within Application (HttpApplicationState), when each key is the IP of the client and the value is the string value.

After Login every client acceses different WebMethods, and for each one the first thing happening is getting the string setting out of the Application, for the current IP.

My problem is that from looking at old EventViewer entries it seems that sometimes the dictionary in Application does not contain the IP of the calling user.

Now I might be wrong, but I've been reading some (too many?) articles and found several possibly related issues. I would like your opinion on them.

1. First of all - am I better off leaving the Application object alone and just keeping it as a singleton instance of the Dictionary in my WS class?

2. If I'm using Application - What is really the lifetime of the object? Should any of these empty/make another instance of the Application contents?
- Worker process recycling?
- Some timeout
- Additional threads created by IIS?

Hope you can help,
Frankie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top