Skip to content

Commit 6c1ced2

Browse files
author
Nikolaj
committed
Merge branch 'v9/dev' of https://github.com/umbraco/Umbraco-CMS into v9/dev
2 parents fd67e19 + cf89841 commit 6c1ced2

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

build/templates/UmbracoPackage/.template.config/template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"version": {
2525
"type": "parameter",
2626
"datatype": "string",
27-
"defaultValue": "9.0.0-rc003",
27+
"defaultValue": "9.0.0-rc004",
2828
"description": "The version of Umbraco to load using NuGet",
2929
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
3030
},

build/templates/UmbracoProject/.template.config/template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"version": {
5858
"type": "parameter",
5959
"datatype": "string",
60-
"defaultValue": "9.0.0-rc003",
60+
"defaultValue": "9.0.0-rc004",
6161
"description": "The version of Umbraco to load using NuGet",
6262
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
6363
},

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<Version>9.0.0</Version>
44
<AssemblyVersion>9.0.0</AssemblyVersion>
5-
<InformationalVersion>9.0.0-rc003</InformationalVersion>
5+
<InformationalVersion>9.0.0-rc004</InformationalVersion>
66
<FileVersion>9.0.0</FileVersion>
77
<LangVersion Condition="'$(LangVersion)' == ''">9.0</LangVersion>
88
<NeutralLanguage>en-US</NeutralLanguage>

src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public class SqlMainDomLock : IMainDomLock
4040
private bool _errorDuringAcquiring;
4141
private readonly object _locker = new object();
4242
private bool _hasTable = false;
43-
43+
private bool _acquireWhenTablesNotAvailable = false;
44+
4445
public SqlMainDomLock(
4546
ILogger<SqlMainDomLock> logger,
4647
ILoggerFactory loggerFactory,
@@ -99,7 +100,8 @@ public async Task<bool> AcquireLockAsync(int millisecondsTimeout)
99100
_hasTable = db.HasTable(Cms.Core.Constants.DatabaseSchema.Tables.KeyValue);
100101
if (!_hasTable)
101102
{
102-
// 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
103+
_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.");
104+
_acquireWhenTablesNotAvailable = true;
103105
return true;
104106
}
105107

@@ -225,6 +227,13 @@ private void ListeningLoop()
225227
}
226228
}
227229

230+
// 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.
231+
if (_acquireWhenTablesNotAvailable)
232+
{
233+
_acquireWhenTablesNotAvailable = false;
234+
InsertLockRecord(_lockId, db);
235+
}
236+
228237
db.BeginTransaction(IsolationLevel.ReadCommitted);
229238
// get a read lock
230239
_sqlServerSyntax.ReadLock(db, Cms.Core.Constants.Locks.MainDom);
@@ -434,7 +443,10 @@ private RecordPersistenceType InsertLockRecord(string id, IUmbracoDatabase db)
434443
private bool IsMainDomValue(string val, IUmbracoDatabase db)
435444
{
436445
return db.ExecuteScalar<int>("SELECT COUNT(*) FROM umbracoKeyValue WHERE [key] = @key AND [value] = @val",
437-
new { key = MainDomKey, val = val }) == 1;
446+
new { key = MainDomKey, val = val }) == 1;
447+
448+
449+
438450
}
439451

440452
/// <summary>
@@ -447,6 +459,7 @@ private bool IsMainDomValue(string val, IUmbracoDatabase db)
447459
#region IDisposable Support
448460
private bool _disposedValue = false; // To detect redundant calls
449461

462+
450463
protected virtual void Dispose(bool disposing)
451464
{
452465
if (!_disposedValue)

0 commit comments

Comments
 (0)