Skip to content
Permalink
Browse files

0002792: DBCompare leaks database resources

  • Loading branch information...
mmichalek committed Sep 13, 2016
1 parent c2dc885 commit dd4a7c9e991d6624da0607c393eab1c3a5e7a75a
Showing with 5 additions and 4 deletions.
  1. +5 −4 symmetric-core/src/main/java/org/jumpmind/symmetric/io/DbCompare.java
@@ -20,11 +20,13 @@
*/
package org.jumpmind.symmetric.io;

import java.io.Closeable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DurationFormatUtils;
import org.jumpmind.db.model.Column;
@@ -155,9 +157,6 @@ protected TableReport compareTables(DbCompareTables tables) {
Row sourceRow = sourceCursor.next();
Row targetRow = targetCursor.next();




int counter = 0;
long startTime = System.currentTimeMillis();
DbCompareDiffWriter diffWriter = new DbCompareDiffWriter(targetEngine, tables, sqlDiffFileName);
@@ -208,6 +207,8 @@ protected TableReport compareTables(DbCompareTables tables) {
}
} finally {
diffWriter.close();
IOUtils.closeQuietly(sourceCursor);
IOUtils.closeQuietly(targetCursor);
}

return tableReport;
@@ -509,7 +510,7 @@ public void setUseSymmetricConfig(boolean useSymmetricConfig) {
this.useSymmetricConfig = useSymmetricConfig;
}

class CountingSqlReadCursor implements ISqlReadCursor<Row> {
class CountingSqlReadCursor implements ISqlReadCursor<Row>, Closeable {

ISqlReadCursor<Row> wrapped;
int count = 0;

0 comments on commit dd4a7c9

Please sign in to comment.
You can’t perform that action at this time.