Merge remote-tracking branch 'origin/6.2.0' into 7.0.0

Conflicts:
	src/Umbraco.Core/Models/DataTypeDefinition.cs
	src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs
	src/Umbraco.Core/Properties/AssemblyInfo.cs
	src/Umbraco.Core/Umbraco.Core.csproj
	src/Umbraco.Web/Security/Providers/MembersMembershipProvider.cs
	src/umbraco.providers/members/MembersMembershipProvider.cs
This commit is contained in:
Shannon
2013-10-11 11:02:35 +11:00
4 changed files with 31 additions and 27 deletions

View File

@@ -42,7 +42,6 @@ namespace Umbraco.Core.Models
{
_parentId = parentId;
_propertyEditorAlias = propertyEditorAlias;
_additionalData = new Dictionary<string, object>();
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.Name);

View File

@@ -2,8 +2,10 @@ using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Data;
using System.Threading;
using System.Xml;
using System.Linq;
using Umbraco.Core;
using umbraco.cms.businesslogic.language;
using umbraco.DataLayer;
using umbraco.BusinessLogic;
@@ -19,7 +21,7 @@ namespace umbraco.cms.businesslogic
public class Dictionary
{
private static volatile bool _cacheIsEnsured = false;
private static readonly object Locker = new object();
private static readonly ReaderWriterLockSlim Locker = new ReaderWriterLockSlim();
private static readonly ConcurrentDictionary<string, DictionaryItem> DictionaryItems = new ConcurrentDictionary<string, DictionaryItem>();
private static readonly Guid TopLevelParent = new Guid("41c7638d-f529-4bff-853e-59a0c2fb1bde");
@@ -33,30 +35,28 @@ namespace umbraco.cms.businesslogic
/// </summary>
private static void EnsureCache()
{
if (!_cacheIsEnsured)
using (var lck = new UpgradeableReadLock(Locker))
{
lock (Locker)
if (_cacheIsEnsured) return;
lck.UpgradeToWriteLock();
using (var dr = SqlHelper.ExecuteReader("Select pk, id, [key], parent from cmsDictionary"))
{
if (!_cacheIsEnsured)
while (dr.Read())
{
using (IRecordsReader dr = SqlHelper.ExecuteReader("Select pk, id, [key], parent from cmsDictionary"))
{
while (dr.Read())
{
//create new dictionaryitem object and put in cache
var item = new DictionaryItem(dr.GetInt("pk"),
dr.GetString("key"),
dr.GetGuid("id"),
dr.GetGuid("parent"));
//create new dictionaryitem object and put in cache
var item = new DictionaryItem(dr.GetInt("pk"),
dr.GetString("key"),
dr.GetGuid("id"),
dr.GetGuid("parent"));
DictionaryItems.TryAdd(item.key, item);
}
}
_cacheIsEnsured = true;
DictionaryItems.TryAdd(item.key, item);
}
}
}
_cacheIsEnsured = true;
}
}
/// <summary>
@@ -64,9 +64,12 @@ namespace umbraco.cms.businesslogic
/// </summary>
internal static void ClearCache()
{
DictionaryItems.Clear();
//ensure the flag is reset so that EnsureCache will re-cache everything
_cacheIsEnsured = false;
using (new WriteLock(Locker))
{
DictionaryItems.Clear();
//ensure the flag is reset so that EnsureCache will re-cache everything
_cacheIsEnsured = false;
}
}
/// <summary>

View File

@@ -792,7 +792,7 @@ namespace umbraco.providers.members
return null;
}
private static string GetMemberProperty(IMember m, string propertyAlias, bool isBool)
{
if (!String.IsNullOrEmpty(propertyAlias))
@@ -1081,6 +1081,7 @@ namespace umbraco.providers.members
DateTime.Now, DateTime.Now, DateTime.Now);
}
}
#endregion
}
}

View File

@@ -1,7 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.20827.3
MinimumVisualStudioVersion = 10.0.40219.1
# Visual Studio 2012
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2849E9D4-3B4E-40A3-A309-F3CB4F0E125F}"
ProjectSection(SolutionItems) = preProject
..\build\Build.bat = ..\build\Build.bat
@@ -177,4 +175,7 @@ Global
{73529637-28F5-419C-A6BB-D094E39DE614} = {DD32977B-EF54-475B-9A1B-B97A502C6E58}
{B555AAE6-0F56-442F-AC9F-EF497DB38DE7} = {DD32977B-EF54-475B-9A1B-B97A502C6E58}
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
EndGlobal