ADO.NET Connection Pooling Explained
Subject:   Recursive
Date:   2005-02-23 09:47:48
From:   CodeHaxor
I think the recursive idea is a bad idea,
it can simply blow the stack, if the pool size
was lets say 1000, you would make a 1000 retries
recursively, dont' you think that perhaps
a while loop would solve this issue in a much
cleaner and faster way?

Also in regards to keeping a connection
static in that would also be a very
bad idea, when multiple datareaders or writers
are trying to access the same connection pool;
it will periodically throw exceptions of
datareader or writer already in use.

I made the fatal mistake of creation my ConnectionManager within my table access classes
static and if two clients using my application where lets say doing a search
the datareader would get used by the first one
and an exception will be thrown for the second.

Microsoft recommends creating a new SqlConnection
for every io; this realistically wont' be a problem considering it will all be pooled at the end.

1 to 1 of 1
  1. Recursive
    2005-07-27 13:18:18  Bill [View]

1 to 1 of 1