ADO.NET Connection Pooling Explained
Subject:   Slightly bad advice
Date:   2004-02-25 08:00:49
From:   asills
While the technique provided here is definitely valid, one huge thing you missed is I would probably bet that a lot of novice web developers will take this code as is and use it in their web applications, without realizing the multi-threaded problems that might arise when using this code.

Since ASP.NET is a multi-threaded environment, multiple threads could be failing and accessing the static variable at the same time, causing the retries variable to change from multiple threads, which would cause its value to be changed by one thread while another thread is dependent on the value being a certain thing.

So just FYI, be wary if you use this code, that it's not thread-safe.

1 to 1 of 1
  1. Slightly bad advice
    2004-04-15 22:58:50  AndrewG [View]

1 to 1 of 1