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
Danatas GerviPosted Nov 12, 2009, 8:51 AM
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...