Database retries within ContentSaveDB causes unexpected exception

Found in

EPiServer.CMS.Core 7.5.394.2

Fixed in

EPiServer.CMS.Core 10.0.1

Created

Aug 26, 2015

Updated

Oct 27, 2016

Area

CMS Core

State

Closed, Fixed and tested


Description

If a deadlock or other transient error in occurs in SQL after a new version has been created, the transaction cannot be retried and instead causes another exception.

For example:

editSaveContentVersionData: The WorkContentId dosen´t exist (WorkContentID=169)
 
 
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
 
 
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
 
 
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
 
 
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)