Nov 23, 2010 at 6:08 PM
Edited Nov 23, 2010 at 6:11 PM
If you create code like this, and the executing stored procedure lasts more than the default timeout it will throw a SqlException into your calling code with a timeout Message:
var database = EnterpriseLibraryContainer.Current.GetInstance<Database>("FooDB")
// create a mapping from the columns in the result data to our data contract object
IRowMapper<Foo> rowMapper = ....Build();
// execute the stored procedure and use the mapping object to return an enumeration of reports
IEnumerable<Foo> results = database.ExecuteSprocAccessor<Foo>("_GetFoos", rowMapper);
var resultArray = results.ToArray();
What I am saying is that there doesn't seem to be any way to override the default timeout value to let the SQL server execute longer before the .NET SQL client throws a SqlException. The ConnectionString for the database doesn't seem to do that. Am I interpreting
its function incorrectly? There doesn't seem to be any other timeout value to override.
I should note that the ConnectionTimeout property on the Database is set correctly after it is obtained by the first call, so that has nothing to do with this issue.