How does the Data Access Application Block re-connects when have network hits

Topics: Data Access Application Block
Feb 26, 2009 at 8:37 PM

After you intialize a Database successfully and then you have a network hit, is the database smart enough to detect it and re-connect?
If set the connection string min pool=0 , will the database get a new connection every time I use a command?

Thanks

Feb 27, 2009 at 1:00 PM

Hi,

I'm not sure what do you mean by your first question, do you mean that, Say when The DAAB successfully created connection to the database, then somewhere along the execution process the database server went down, the DAAB will detect that something happened to the database server then tries a reconnect and continue with the execution? Is that what you mean?

On your second question, what is your purpose of setting the min pool to zero? are you trying not to use connection pooling? Anyway, as I've read in http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx , 

If MinPoolSize is either not specified in the connection string or is specified as zero, the connections in the pool will be closed after a period of inactivity. However, if the specified MinPoolSize is greater than zero, the connection pool is not destroyed until the AppDomain is unloaded and the process ends. Maintenance of inactive or empty pools involves minimal system overhead.

Connection pooling:
http://www.codeproject.com/KB/dotnet/ADONET_ConnectionPooling.aspx


Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Feb 27, 2009 at 3:00 PM
I was looking for re-connection in a very short timespan. Say DAAB successfully created connection and is executing a cmd. The network goes down for a "miliseconds". The DAAB will throw an exception and db will rollback if applicable. Now we will try to get a DAAB connection to execute other sql cmds. Is DAAB smart to see that something happened on prior cmd and  try to get a good connection trying n-number of times ?

Thanks


Mar 2, 2009 at 7:37 AM
No, DAAB just checks if there's an existing connection (case when the command is part of a transaction), or creates a new one if it doesn't find any and assigns it to the command to be executed.


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com