From 67096961ce159df6b0f1f6c44a06c5f5e1e91cc7 Mon Sep 17 00:00:00 2001 From: mvarblow Date: Wed, 11 Nov 2015 12:19:59 -0500 Subject: [PATCH] Update CacheItemRecord.cs Fixed database output cache module when using SQL Server database. This resolves the following exception which results from NHibernate trying to truncate the Output field to 8K: NHibernate.AssertionFailure: null id in Orchard.OutputCache.Models.CacheItemRecord entry (don't flush the Session after an exception occurs) --- .../Modules/Orchard.OutputCache/Models/CacheItemRecord.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.OutputCache/Models/CacheItemRecord.cs b/src/Orchard.Web/Modules/Orchard.OutputCache/Models/CacheItemRecord.cs index 6cd345e8b..245964026 100644 --- a/src/Orchard.Web/Modules/Orchard.OutputCache/Models/CacheItemRecord.cs +++ b/src/Orchard.Web/Modules/Orchard.OutputCache/Models/CacheItemRecord.cs @@ -12,7 +12,7 @@ namespace Orchard.OutputCache.Models { public virtual int GraceTime { get; set; } public virtual DateTime ValidUntilUtc { get; set; } public virtual DateTime StoredUntilUtc { get; set; } - public virtual byte[] Output { get; set; } + [StringLengthMax] public virtual byte[] Output { get; set; } public virtual string ContentType { get; set; } [StringLength(2048)] public virtual string QueryString { get; set; } [StringLength(2048)] public virtual string CacheKey { get; set; } @@ -22,4 +22,4 @@ namespace Orchard.OutputCache.Models { public virtual int StatusCode { get; set; } [StringLengthMax] public virtual string Tags { get; set; } } -} \ No newline at end of file +}