Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2011-06-15 13:48:44 -0400
committerRyan D. Brooks2011-06-15 13:48:44 -0400
commitd3406e020c1ac1208b24573a7abda5608b2be01c (patch)
treeb3821659101b3c58a27615b2f89788fec4b3bb84
parent6e67ac7427a181f471b9bb24e65b5030c8c3fd0d (diff)
downloadorg.eclipse.osee-d3406e020c1ac1208b24573a7abda5608b2be01c.tar.gz
org.eclipse.osee-d3406e020c1ac1208b24573a7abda5608b2be01c.tar.xz
org.eclipse.osee-d3406e020c1ac1208b24573a7abda5608b2be01c.zip
refinement: Improve performance of database export by increasing fetch size
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/export/DbTableExportItem.java38
1 files changed, 9 insertions, 29 deletions
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/export/DbTableExportItem.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/export/DbTableExportItem.java
index f0079829f8..400a9aca1d 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/export/DbTableExportItem.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/export/DbTableExportItem.java
@@ -34,22 +34,17 @@ import org.eclipse.osee.framework.resource.management.Options;
*/
public class DbTableExportItem extends AbstractDbExportItem {
private final String query;
- private final StringBuffer binaryContentBuffer;
- private final StringBuffer stringContentBuffer;
- private final StringBuffer oseeCommentBuffer;
- private final StringBuffer branchNameBuffer;
- private final StringBuffer rationaleBuffer;
+ private final StringBuffer binaryContentBuffer = new StringBuffer();
+ private final StringBuffer stringContentBuffer = new StringBuffer();
+ private final StringBuffer oseeCommentBuffer = new StringBuffer();
+ private final StringBuffer branchNameBuffer = new StringBuffer();
+ private final StringBuffer rationaleBuffer = new StringBuffer();
private final OseeServices services;
public DbTableExportItem(OseeServices services, ExportItem id, String query) {
super(id);
this.services = services;
this.query = query;
- this.binaryContentBuffer = new StringBuffer();
- this.stringContentBuffer = new StringBuffer();
- this.oseeCommentBuffer = new StringBuffer();
- this.branchNameBuffer = new StringBuffer();
- this.rationaleBuffer = new StringBuffer();
}
protected String exportBinaryDataTo(File tempFolder, String uriTarget) throws Exception {
@@ -73,18 +68,8 @@ public class DbTableExportItem extends AbstractDbExportItem {
outputStream = new FileOutputStream(target);
Lib.inputStreamToOutputStream(sourceStream, outputStream);
} finally {
- if (sourceStream != null) {
- try {
- sourceStream.close();
- } catch (Exception ex) {
- }
- }
- if (outputStream != null) {
- try {
- outputStream.close();
- } catch (Exception ex) {
- }
- }
+ Lib.close(sourceStream);
+ Lib.close(outputStream);
}
return locator.getRawPath().replace('/', '\\');
}
@@ -94,7 +79,7 @@ public class DbTableExportItem extends AbstractDbExportItem {
IOseeStatement chStmt = services.getDatabaseService().getStatement(getConnection());
try {
Pair<String, Object[]> sqlData = ExchangeDb.getQueryWithOptions(this.query, getJoinQueryId(), getOptions());
- chStmt.runPreparedQuery(sqlData.getFirst(), sqlData.getSecond());
+ chStmt.runPreparedQuery(10000, sqlData.getFirst(), sqlData.getSecond());
while (chStmt.next()) {
processData(appendable, chStmt);
}
@@ -199,9 +184,4 @@ public class DbTableExportItem extends AbstractDbExportItem {
ExportImportXml.closeXmlNode(appendable, tag);
}
}
-
- @Override
- public void cleanUp() {
- super.cleanUp();
- }
-}
+} \ No newline at end of file

Back to the top