CLW
October 2nd, 2001, 04:45 PM
I have come across the following problem: my web hosting company is
enforcing a policy of maximum number of allowed connections to SQL Server.
When connection limit is reached, any new connection attempt would be
denied.
Now how do I handle this situation gracefully? In particular, how do I
insulate this limitation from user experience.
I know OLE DB supports connection pooling. Does it let you set a maximum
number of allowed connections (remember I am limited to using VB only). If
it does, what is the behavior of VB when connection limit is encountered?
Exception? Or is there anyway for ADODB connection attempt to be queued
until connection becomes available?
If not, then what is the best way of handling this situation? I suppose I
can code in such a way that I would catch the exception (btw, what's error
code for such an exception?), and delay for a short amount of time, and then
retry. I personally find this solution rather inelegant (possibly
problematic as well - since it is possible that after a short delay, some
other processes would have taken up the connection freed). I would need to
recode every single routines in my data access layer for this to work.
Any idea, elegant solutions are much appreciated.
Thanks in advance
enforcing a policy of maximum number of allowed connections to SQL Server.
When connection limit is reached, any new connection attempt would be
denied.
Now how do I handle this situation gracefully? In particular, how do I
insulate this limitation from user experience.
I know OLE DB supports connection pooling. Does it let you set a maximum
number of allowed connections (remember I am limited to using VB only). If
it does, what is the behavior of VB when connection limit is encountered?
Exception? Or is there anyway for ADODB connection attempt to be queued
until connection becomes available?
If not, then what is the best way of handling this situation? I suppose I
can code in such a way that I would catch the exception (btw, what's error
code for such an exception?), and delay for a short amount of time, and then
retry. I personally find this solution rather inelegant (possibly
problematic as well - since it is possible that after a short delay, some
other processes would have taken up the connection freed). I would need to
recode every single routines in my data access layer for this to work.
Any idea, elegant solutions are much appreciated.
Thanks in advance