Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Commit

Permalink
Fix bad transaction pattern introduced with 927256.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@930332 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
eigood committed Apr 2, 2010
1 parent 0a3243a commit f52d9e7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public static Map<String, Object> entityExportAll(DispatchContext dctx, Map<Stri
continue;
}

TransactionUtil.begin();
boolean beganTx = TransactionUtil.begin();
// some databases don't support cursors, or other problems may happen, so if there is an error here log it and move on to get as much as possible
try {
values = delegator.find(curEntityName, null, null, null, me.getPkFieldNames(), null);
Expand All @@ -530,8 +530,8 @@ public static Map<String, Object> entityExportAll(DispatchContext dctx, Map<Stri
value.writeXmlText(writer, "");
numberWritten++;
if (numberWritten % 500 == 0) {
TransactionUtil.commit();
TransactionUtil.begin();
TransactionUtil.commit(beganTx);
beganTx = TransactionUtil.begin();
}
} while ((value = (GenericValue) values.next()) != null);
writer.println("</entity-engine-xml>");
Expand All @@ -541,7 +541,7 @@ public static Map<String, Object> entityExportAll(DispatchContext dctx, Map<Stri
results.add("["+fileNumber +"] [---] " + curEntityName + " has no records, not writing file");
}
values.close();
TransactionUtil.commit();
TransactionUtil.commit(beganTx);
} catch (Exception ex) {
if (values != null) {
try {
Expand Down

0 comments on commit f52d9e7

Please sign in to comment.