WCF RIA Services and SQL Azure transient fault handling
Is there any published guidance for handling transient fault scenarios in SQL Azure when using WCF RIA Services backed by Entity Framework and/or Linq to SQL?
We have studied the CAT retry library (Transient Fault Handling Framework for SQL Azure) and documentation (Retry Logic for Transient Failures in SQL Azure), particularly the sections as they relate to Entity Framework and Linq to SQL.
For example, in the case of Linq to SQL, we are instructed to wrap our query/update code into an ExecuteAction and execute it with a RetryPolicy.
This article (Silverlight 4, EF 4, RIA Services & Windows Azure together) suggests that the best we can hope for is to add resiliancy to the connection. However, it appears that we may get the result we want by overriding the PersistChangeSet method on LinqToEntitiesDomainService and LinqToSqlDomainService and adding our retry there.
eg (Pseudo code)
protected override bool PersistChangeSet()
{
e.Result = retry.ExecuteAction(() =>
{
return base.PersistChangeSet();
});
return e.Result;
}
Any thoughts to this approach? Is there any documentation or guidance out there, specifically as relates to RIA Services?
This was originally going to be a comment but...
I recently used the RetryPolicy class with entity framework and encountered no problems. Adding the retries is extremely simple and low impact.
The article linked is dated (May 30) which is before they added support for azure to the enterprise library. (see this announcement)
So based on the scenario described above I would say that the RetryPolicy will satisfy the requirements described.
链接地址: http://www.djcxy.com/p/90226.html上一篇: Sql Azure中的强制性主键