Women in Technology

Hear us Roar



Article:
  ADO.NET Connection Pooling Explained
Subject:   Recursive
Date:   2005-07-27 13:18:18
From:   Bill
Response to: Recursive

Yes the recursive idea is bad. Especially as written in the sample code.
First the num_tries counter never gets incremented as the recursion progresses.
Secondly, suppose max_tries is 100. And it takes 50 tries to find a working connection. Once this happens, the ExecuteDataReader will recursively re-execute 50 times as it ripples up the stack.


Too bad the author didn't understand recursion or test his code