U4-8536 - removing db.GetTransaction wherever possible

This commit is contained in:
Stephan
2016-05-30 19:47:49 +02:00
parent f584404324
commit bc45dd8d6a
16 changed files with 218 additions and 310 deletions

View File

@@ -1867,7 +1867,7 @@ WHERE cmsContentXml.nodeId IN (
// because we already have the condition on the content being published
var descendants = repository.GetPagedResultsByQuery(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true, newest: false);
var items = descendants.Select(c => new ContentXmlDto { NodeId = c.Id, Xml = _xmlContentSerializer(c).ToDataString() }).ToArray();
db.BulkInsertRecords(db.SqlSyntax, items, null, false); // run within the current transaction and do NOT commit
db.BulkInsertRecords(db.SqlSyntax, items);
processed += items.Length;
} while (processed < total);
}
@@ -1942,7 +1942,7 @@ WHERE cmsPreviewXml.nodeId IN (
NodeId = c.Id,
Xml = _xmlContentSerializer(c).ToDataString()
}).ToArray();
db.BulkInsertRecords(db.SqlSyntax, items, null, false); // run within the current transaction and do NOT commit
db.BulkInsertRecords(db.SqlSyntax, items);
processed += items.Length;
} while (processed < total);
}
@@ -2011,7 +2011,7 @@ WHERE cmsContentXml.nodeId IN (
{
var descendants = repository.GetPagedResultsByQuery(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
var items = descendants.Select(m => new ContentXmlDto { NodeId = m.Id, Xml = _xmlMediaSerializer(m).ToDataString() }).ToArray();
db.BulkInsertRecords(db.SqlSyntax, items, null, false); // run within the current transaction and do NOT commit
db.BulkInsertRecords(db.SqlSyntax, items);
processed += items.Length;
} while (processed < total);
}
@@ -2080,7 +2080,7 @@ WHERE cmsContentXml.nodeId IN (
{
var descendants = repository.GetPagedResultsByQuery(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
var items = descendants.Select(m => new ContentXmlDto { NodeId = m.Id, Xml = _xmlMemberSerializer(m).ToDataString() }).ToArray();
db.BulkInsertRecords(db.SqlSyntax, items, null, false); // run within the current transaction and do NOT commit
db.BulkInsertRecords(db.SqlSyntax, items);
processed += items.Length;
} while (processed < total);
}