Possible Duplicate:
Accessing PerSession service simultaneously in WCF using C#
I have implemented a c# wcf service which has method s1 and method s2. method s1 is the main process that does the processing and method s2 is a secondary method that keeps track of the method s1 status based on two static int variables(total,current).
total ----> indicates the total number of tasks.
current-----> indicates the current task that is being processed.
I have also created 3 c# clients that calls the web service asynchronously. these below mentioned are the client methods.
client1: c11,c12
client2: c21,c22
client3: c31,c32
all these 3 client methods make calls to the service parallel. So now my problem is as the 2 variables total and current are static variables. when all the three clients are calling the service at the same time the total and current values are being mixed up instead of being separate for each client.
example in a normal eligible scenario they are supposed to be like this:
client1: (total,current)------>(3,1)(3,2)(3,3)
client2: (total,current)------>(2,1)(2,2)
client3: (total,current)------>(4,1)(4,2)(4,3)(4,4)
but now i my regular scenario i am getting the values all mixed up as the total variable value is not supposed to be changed for any client it is supposed to be the same. as these two variables total and current will be accessed all over my wcf application and will get modified i made them as static in a class so that they can be made as global and can be accessed by the class name where ever i want in the wcf program. So i am unable figure it out how to solve this can any one please help.