# Error saving changes properties on website

**URL:** <https://forum.litium.com/t/error-saving-changes-properties-on-website/1108>\
**Category:** Questions\
**Created:** [September 20, 2019, 9:32am UTC](https://forum.litium.com/t/error-saving-changes-properties-on-website/1108 "2019-09-20T09:32:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![NiclasSparr](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/niclassparr/32/96_2.png) [@NiclasSparr](https://forum.litium.com/u/NiclasSparr)\
**Post date:** [September 20, 2019, 9:32am UTC](https://forum.litium.com/t/error-saving-changes-properties-on-website/1108/1 "2019-09-20T09:32:35Z")

</div>

Hi,  
I got the following error when trying to save changes on Website in backoffice.  
Any ideas what’s wrong?

IWebLog exception ‘Database operation expected to affect 1 row(s) but actually affected 0 row(s). Data may have been modified or deleted since entities were loaded. See [http://go.microsoft.com/fwlink/?LinkId=527962](http://go.microsoft.com/fwlink/?LinkId=527962) for information on understanding and handling optimistic concurrency exceptions.’: 2e820277-cf30-48ae-b652-0a5486ff6a76

Litium.Data.DataException: Database operation expected to affect 1 row(s) but actually affected 0 row(s). Data may have been modified or deleted since entities were loaded. See [http://go.microsoft.com/fwlink/?LinkId=527962](http://go.microsoft.com/fwlink/?LinkId=527962) for information on understanding and handling optimistic concurrency exceptions. —\> Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: Database operation expected to affect 1 row(s) but actually affected 0 row(s). Data may have been modified or deleted since entities were loaded. See [http://go.microsoft.com/fwlink/?LinkId=527962](http://go.microsoft.com/fwlink/?LinkId=527962) for information on understanding and handling optimistic concurrency exceptions.  
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ThrowAggregateUpdateConcurrencyException(Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected)  
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeResultSetWithoutPropagation(Int32 commandIndex, RelationalDataReader reader)  
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.Consume(RelationalDataReader reader)  
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)  
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(DbContext \_, ValueTuple`2 parameters) at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementation[TState,TResult](Func`3 operation, Func`3 verifySucceeded, TState state) at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)  
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess) at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess) at Litium.Application.Data.LitiumDbContext.SaveChanges(Boolean acceptAllChangesOnSuccess) --- End of inner exception stack trace --- at Litium.Application.Data.LitiumDbContext.SaveChanges(Boolean acceptAllChangesOnSuccess) at Litium.Application.Data.Batching.BatchDataImpl.Commit() at Litium.Application.Websites.WebsiteServiceImpl.Update(Website website) at Litium.Web.Administration.WebApi.CMS.EditorHandlers.WebsiteFieldEditorHandler.Save(FormFieldList model) at System.Threading.Tasks.Task`1.InnerInvoke()  
at System.Threading.Tasks.Task.Execute()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at Litium.Web.Administration.WebApi.Common.Controllers.ObjectSchemaController.d\_\_5.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Threading.Tasks.TaskHelpersExtensions.d\_\_1`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__17`1.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Controllers.ApiControllerActionInvoker.d\_\_1.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Tracing.ITraceWriterExtensions.d\_\_17`1.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Filters.ActionFilterAttribute.d\_\_6.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Web.Http.Filters.ActionFilterAttribute.d\_\_6.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Filters.ActionFilterAttribute.d\_\_5.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Controllers.ActionFilterResult.d\_\_5.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Filters.AuthorizationFilterAttribute.d\_\_3.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Filters.AuthorizationFilterAttribute.d\_\_3.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Controllers.ExceptionFilterResult.d\_\_6.MoveNext()

Litium version: 7.2.0

---

<div class="post-metadata">

**Author:** ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)\
**Post date:** [September 20, 2019, 12:04pm UTC](https://forum.litium.com/t/error-saving-changes-properties-on-website/1108/2 "2019-09-20T12:04:32Z")

</div>

Sounds like there’s some inconsistent data between the cache and the database. Have you tried recycling the app pool to flush the cache?

---

<div class="post-metadata">

**Author:** ![NiclasSparr](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/niclassparr/32/96_2.png) [@NiclasSparr](https://forum.litium.com/u/NiclasSparr)\
**Post date:** [September 20, 2019, 12:46pm UTC](https://forum.litium.com/t/error-saving-changes-properties-on-website/1108/3 "2019-09-20T12:46:14Z")

</div>

yes, I restarted the IIS, still same problem.

/Niclas

---

<div class="post-metadata">

**Author:** ![rene.eriksson](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@rene.eriksson](https://forum.litium.com/u/rene.eriksson)\
**Post date:** [October 7, 2019, 11:10am UTC](https://forum.litium.com/t/error-saving-changes-properties-on-website/1108/4 "2019-10-07T11:10:06Z")

</div>

Hi @NiclasSparr, we currently experience the same issue as you had. Did you find any solution to this problem?

/René

---

<div class="post-metadata">

**Author:** ![NiclasSparr](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/niclassparr/32/96_2.png) [@NiclasSparr](https://forum.litium.com/u/NiclasSparr)\
**Post date:** [October 7, 2019, 11:33am UTC](https://forum.litium.com/t/error-saving-changes-properties-on-website/1108/5 "2019-10-07T11:33:28Z")

</div>

Hi @rene.Eriksson,  
No we didn’t. We had another copy of the database that was working, so we switched to that one.

/Niclas

---

<div class="post-metadata">

**Author:** ![mynameisandreas](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/mynameisandreas/32/282_2.png) [@mynameisandreas](https://forum.litium.com/u/mynameisandreas)\
**Post date:** [October 10, 2019, 11:02am UTC](https://forum.litium.com/t/error-saving-changes-properties-on-website/1108/6 "2019-10-10T11:02:54Z")

</div>

We have this issue on in all our environments now, which means we dont have any working database. Do we have some status on the issue?!

---

<div class="post-metadata">

**Author:** ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)\
**Post date:** [October 11, 2019, 6:39am UTC](https://forum.litium.com/t/error-saving-changes-properties-on-website/1108/7 "2019-10-11T06:39:42Z")

</div>

Which version are you on? Can you apply the latest service release?

You can enable logging of the SQL queries by commenting out this line in `nlog.config`:  
`<logger name="Microsoft.EntityFrameworkCore.*" minlevel="Trace" writeTo="BlackHole" final="true"/>`

Also add this to `appSettings` in Web.config:  
`<add key="Litium:Data:EnableSensitiveDataLogging" value="true" />`

This will generate a lot of data in the log (so don’t do it in production environment) and enable you to see the queries sent to the database.

---

<div class="post-metadata">

**Author:** ![mynameisandreas](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/mynameisandreas/32/282_2.png) [@mynameisandreas](https://forum.litium.com/u/mynameisandreas)\
**Post date:** [October 29, 2019, 10:30am UTC](https://forum.litium.com/t/error-saving-changes-properties-on-website/1108/8 "2019-10-29T10:30:44Z")

</div>

We updated to the latest pre-release and that solved the issue. But if we get the problem again I’ll try this.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [November 26, 2019, 10:30am UTC](https://forum.litium.com/t/error-saving-changes-properties-on-website/1108/9 "2019-11-26T10:30:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
