Static methods and sessions
Hi there
If you use WCF and set the host to create sessions, I am wondering what happens when two sessions simultaneously use a static method?
for example, if session A calls static dosomething which creates, for example, an SQL string, and then session B calls it, is session B blocked until A finishes? or can session B corrupt A's data?
What if the method is not static, but there is only one object to use (a singleton)? Is it any different?
Thanks
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Danatas GerviRank #4,152 · 361 reputationPosted Nov 12, 2009, 3:51 AM EST
Static method demand to send as parameters all what it need for work.So, every call it will get different data. There is no collision posible.
(Exept using the static variables)
Thread safety - this is different question, and not linked to static-dynamic modificators...