Merge branch 'v9/dev' of https://github.com/umbraco/Umbraco-CMS into v9/dev

This commit is contained in:
Nikolaj
2021-09-21 13:56:54 +02:00
4 changed files with 19 additions and 6 deletions

View File

@@ -24,7 +24,7 @@
"version": {
"type": "parameter",
"datatype": "string",
"defaultValue": "9.0.0-rc003",
"defaultValue": "9.0.0-rc004",
"description": "The version of Umbraco to load using NuGet",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},

View File

@@ -57,7 +57,7 @@
"version": {
"type": "parameter",
"datatype": "string",
"defaultValue": "9.0.0-rc003",
"defaultValue": "9.0.0-rc004",
"description": "The version of Umbraco to load using NuGet",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<Version>9.0.0</Version>
<AssemblyVersion>9.0.0</AssemblyVersion>
<InformationalVersion>9.0.0-rc003</InformationalVersion>
<InformationalVersion>9.0.0-rc004</InformationalVersion>
<FileVersion>9.0.0</FileVersion>
<LangVersion Condition="'$(LangVersion)' == ''">9.0</LangVersion>
<NeutralLanguage>en-US</NeutralLanguage>

View File

@@ -40,7 +40,8 @@ namespace Umbraco.Cms.Infrastructure.Runtime
private bool _errorDuringAcquiring;
private readonly object _locker = new object();
private bool _hasTable = false;
private bool _acquireWhenTablesNotAvailable = false;
public SqlMainDomLock(
ILogger<SqlMainDomLock> logger,
ILoggerFactory loggerFactory,
@@ -99,7 +100,8 @@ namespace Umbraco.Cms.Infrastructure.Runtime
_hasTable = db.HasTable(Cms.Core.Constants.DatabaseSchema.Tables.KeyValue);
if (!_hasTable)
{
// the Db does not contain the required table, we must be in an install state we have no choice but to assume we can acquire
_logger.LogDebug("The DB does not contain the required table so we must be in an install state. We have no choice but to assume we can acquire.");
_acquireWhenTablesNotAvailable = true;
return true;
}
@@ -225,6 +227,13 @@ namespace Umbraco.Cms.Infrastructure.Runtime
}
}
// In case we acquired the main dom doing install when there was no database. We therefore have to insert our lockId now, but only handle this once.
if (_acquireWhenTablesNotAvailable)
{
_acquireWhenTablesNotAvailable = false;
InsertLockRecord(_lockId, db);
}
db.BeginTransaction(IsolationLevel.ReadCommitted);
// get a read lock
_sqlServerSyntax.ReadLock(db, Cms.Core.Constants.Locks.MainDom);
@@ -434,7 +443,10 @@ namespace Umbraco.Cms.Infrastructure.Runtime
private bool IsMainDomValue(string val, IUmbracoDatabase db)
{
return db.ExecuteScalar<int>("SELECT COUNT(*) FROM umbracoKeyValue WHERE [key] = @key AND [value] = @val",
new { key = MainDomKey, val = val }) == 1;
new { key = MainDomKey, val = val }) == 1;
}
/// <summary>
@@ -447,6 +459,7 @@ namespace Umbraco.Cms.Infrastructure.Runtime
#region IDisposable Support
private bool _disposedValue = false; // To detect redundant calls
protected virtual void Dispose(bool disposing)
{
if (!_disposedValue)