Navigation Menu

Skip to content

Commit

Permalink
0002792: DBCompare leaks database resources
Browse files Browse the repository at this point in the history
  • Loading branch information
mmichalek committed Sep 13, 2016
1 parent 15ea65c commit 6c26396
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -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;
Expand Down Expand Up @@ -182,6 +184,8 @@ protected TableReport compareTables(DbCompareTables tables) {
}
} finally {
diffWriter.close();
IOUtils.closeQuietly(sourceCursor);
IOUtils.closeQuietly(targetCursor);
}

return tableReport;
Expand Down Expand Up @@ -483,7 +487,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;
Expand Down

0 comments on commit 6c26396

Please sign in to comment.