Adding fault handling extensions for IDbCommand.

Adding unit tests to verify retry strategies.
Adding a RetryPolicy factory for our standard configuration.
This commit is contained in:
Morten Christensen
2013-02-05 14:31:55 -01:00
parent ef20f228ec
commit 31a5363387
9 changed files with 257 additions and 17 deletions

View File

@@ -62,7 +62,8 @@ namespace Umbraco.Core.Persistence
//double check
if (_globalInstance == null)
{
_globalInstance = string.IsNullOrEmpty(_providerName) == false && string.IsNullOrEmpty(_providerName) == false
_globalInstance = string.IsNullOrEmpty(_connectionString) == false &&
string.IsNullOrEmpty(_providerName) == false
? new UmbracoDatabase(_connectionString, _providerName)
: new UmbracoDatabase(_connectionStringName);
}
@@ -74,10 +75,11 @@ namespace Umbraco.Core.Persistence
//we have an http context, so only create one per request
if (!HttpContext.Current.Items.Contains(typeof(DefaultDatabaseFactory)))
{
HttpContext.Current.Items.Add(typeof (DefaultDatabaseFactory),
string.IsNullOrEmpty(_providerName) == false && string.IsNullOrEmpty(_providerName) == false
? new UmbracoDatabase(_connectionString, _providerName)
: new UmbracoDatabase(_connectionStringName));
HttpContext.Current.Items.Add(typeof (DefaultDatabaseFactory),
string.IsNullOrEmpty(_connectionString) == false &&
string.IsNullOrEmpty(_providerName) == false
? new UmbracoDatabase(_connectionString, _providerName)
: new UmbracoDatabase(_connectionStringName));
}
return (UmbracoDatabase)HttpContext.Current.Items[typeof(DefaultDatabaseFactory)];
}