I still got a timeout exception in my async callback:
private void DoTask()
{
StoredProcQuery spQuery = m_EntityManager.MySP(...);
// Does not help, though reference help mentioned the default Timeout is 1 minute for UseDTCOption.True
//TransactionSettings txnSettings = new TransactionSettings(UseDTCOption.True);
//spQuery.QueryStrategy = new QueryStrategy(QueryStrategy.DataSourceOnly, txnSettings);
Guid id = Guid.NewGuid();
m_EntityManager.ExecuteQueryAsync(spQuery, new AsyncCompletedCallback<EntityFetchedEventArgs>(AsyncFetchCompleted), id);
}
private static void AsyncFetchCompleted(EntityFetchedEventArgs e)
{
if (e.Error != null)
{
throw e.Error; // timeout exception in InnerException
}
You can easily simulate timeout by placing a delay > 30seconds at the start of any SP:
WAITFOR DELAY '00:00:50';
Looks like EntityManager's ExecuteQueryAsync(...) is not implemented using Asynchronous SqlCommand, or am I wrong?