Improved: Performance optimization for entities in xml data export.

(OFBIZ-10157)

Thanks Kyra Pritzel-Hentley for reporting and providing the patch.
This commit is contained in:
Michael Brohl
2020-02-25 20:31:53 +01:00
parent f3d3547515
commit 74db8bde12
@@ -180,7 +180,7 @@ if (passedEntityNames) {
session.setAttribute("xmlrawdump_entitylist", passedEntityNames)
session.setAttribute("entityDateCond", entityDateCond)
} else {
efo = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true)
efo = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, false)
numberOfEntities = passedEntityNames?.size() ?: 0
context.numberOfEntities = numberOfEntities
numberWritten = 0
@@ -206,9 +206,9 @@ if (passedEntityNames) {
try {
me = reader.getModelEntity(curEntityName)
if (me.getNoAutoStamp() || me instanceof ModelViewEntity) {
values = delegator.find(curEntityName, null, null, null, me.getPkFieldNames(), efo)
values = delegator.find(curEntityName, null, null, null, null, efo)
} else {
values = delegator.find(curEntityName, entityDateCond, null, null, UtilMisc.toList("-createdTxStamp"), efo)
values = delegator.find(curEntityName, entityDateCond, null, null, null, efo)
}
curNumberWritten = 0
@@ -261,9 +261,9 @@ if (passedEntityNames) {
return
}
if (me.getNoAutoStamp() || me instanceof ModelViewEntity) {
values = delegator.find(curEntityName, null, null, null, me.getPkFieldNames(), efo)
values = delegator.find(curEntityName, null, null, null, null, efo)
} else {
values = delegator.find(curEntityName, entityDateCond, null, null, me.getPkFieldNames(), efo)
values = delegator.find(curEntityName, entityDateCond, null, null, null, efo)
}
isFirst = true
writer = null