{"action":"opened","issue":{"url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/5480","labels_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/5480/labels{/name}","comments_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/5480/comments","events_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/5480/events","html_url":"https://github.com/OrchardCMS/Orchard/issues/5480","id":93362301,"number":5480,"title":"Could not sync database state with session","user":{"login":"dcinzona","id":52411,"avatar_url":"https://avatars.githubusercontent.com/u/52411?v=3","gravatar_id":"","url":"https://api.github.com/users/dcinzona","html_url":"https://github.com/dcinzona","followers_url":"https://api.github.com/users/dcinzona/followers","following_url":"https://api.github.com/users/dcinzona/following{/other_user}","gists_url":"https://api.github.com/users/dcinzona/gists{/gist_id}","starred_url":"https://api.github.com/users/dcinzona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcinzona/subscriptions","organizations_url":"https://api.github.com/users/dcinzona/orgs","repos_url":"https://api.github.com/users/dcinzona/repos","events_url":"https://api.github.com/users/dcinzona/events{/privacy}","received_events_url":"https://api.github.com/users/dcinzona/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-06T19:48:57Z","updated_at":"2015-07-06T19:48:57Z","closed_at":null,"body":"I'm not sure what is causing this, but it appears that every few hours, we get the following error in the logs\r\n\r\nMessage\r\n```\r\nCould not synchronize database state with session\r\n```\r\n\r\nException\r\n```\r\nNHibernate.StaleStateException: Batch update returned unexpected row count from update; actual row count: 1; expected: 2\r\n   at NHibernate.AdoNet.Expectations.VerifyOutcomeBatched(Int32 expectedRowCount, Int32 rowCount)\r\n   at NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps)\r\n   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatchWithTiming(IDbCommand ps)\r\n   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatch()\r\n   at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)\r\n   at NHibernate.Engine.ActionQueue.ExecuteActions()\r\n   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)\r\n```\r\n\r\nStacktrace\r\n```\r\nat NHibernate.AdoNet.Expectations.VerifyOutcomeBatched(Int32 expectedRowCount, Int32 rowCount)\r\n   at NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps)\r\n   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatchWithTiming(IDbCommand ps)\r\n   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatch()\r\n   at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)\r\n   at NHibernate.Engine.ActionQueue.ExecuteActions()\r\n   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)\r\n```\r\n\r\nI've been trying to locate the cause of the error, and am unable to flush it out.  Has anyone else seen these errors?  Seems to happen when running on multiple instances (Azure Web Apps and Cloud Services)"}}