I’m not sure if this should be treated as a bug or just an inquiry about how the CommandTimeOut property works but I’ll post this here anyway.
We are using the LLBLGenPro 5.3 on our web application and the database is Azure SQL Server.
In the system we have a reporting section where users can get tabular data in the system from database tables that are quite large or around (7-15 million rows). Instead of using conditional boundaries to narrow the search criteria as the amount of data differs heavily between clients, we would like to instead use a time out value that stops the query after a specific amount of time and notifies the users and encourages him to narrow the search criteria.
This brings me back to my topic that I’ve tried using the CommandTimeOut property for this purpose but it’s not working consistently. Sometime is works and sometimes it doesn’t. In our case we have the limit set to 90 seconds, but I’ve seen our system hang for over 10 minutes on the same query making the system almost unusable as the DTU level on Azure is at max.
This is the get method we’re using:
public EntityCollection<K> GetAll(IRelationPredicateBucket filter, IPrefetchPath2 prefetchPath, ISortExpression sorter, ExcludeIncludeFieldsList excludeIncludeFieldsList)
{
EntityCollection<K> entityCollection = new EntityCollection<K>();
try
{
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
SetLLBGenConfigurations(adapter);
adapter.FetchEntityCollection(entityCollection, filter, 0, sorter, prefetchPath, excludeIncludeFieldsList);
} // using
}
catch (Exception ex)
{
_logger.Error("GetAll Error", ex);
}
return entityCollection;
}
protected void SetLLBGenConfigurations(DataAccessAdapter adapter)
{
RecoveryDelay delay = new RecoveryDelay(new TimeSpan(0, 0, LLBGenStrategyRecoveryDelayInSeconds), 2, RecoveryStrategyDelayType.Linear);
var strategy = new SqlAzureRecoveryStrategy(LLBGenStrategyMaximumNumberOfRetries, delay);
adapter.ActiveRecoveryStrategy = strategy;
adapter.CommandTimeOut = 90;
}
Is it not my correct understanding that this CommandTimeOut should be working consistently and stopping the query after 90 seconds ?