public static IsTransient ( |
||
sqlEx | ||
return | bool |
protected void TryRollBack(SqlTransaction transaction, SqlException sqlEx) { try { transaction.Rollback(); } catch (Exception) { throw new Exception("Add failed. Error during transaction, then error during rollback. Rollback was NOT successfully executed", sqlEx); } if (TransientErrorDetector.IsTransient(sqlEx)) { throw new TransientException("A transient exception has occurred. Add failed. Error during transaction. Rollback successfully executed", sqlEx); } throw new Exception("Add failed. Error during transaction. Rollback successfully executed", sqlEx); }
protected SqlConnection CreateNewConnection(TaskId taskId) { try { var connection = new SqlConnection(ConnectionStore.Instance.GetConnection(taskId).ConnectionString); connection.Open(); return(connection); } catch (SqlException sqlEx) { if (TransientErrorDetector.IsTransient(sqlEx)) { throw new TransientException("A transient exception has occurred", sqlEx); } throw; } }
protected async Task <SqlConnection> CreateNewConnectionAsync(TaskId taskId) { try { var connection = new SqlConnection(ConnectionStore.Instance.GetConnection(taskId).ConnectionString); await connection.OpenAsync().ConfigureAwait(false); return(connection); } catch (SqlException sqlEx) { if (TransientErrorDetector.IsTransient(sqlEx)) { throw new TransientException("A transient exception has occurred", sqlEx); } throw; } }