Delete transform doesn't properly close transactions
@@ -251,9 +251,18 @@ public class Delete extends BaseTransform<DeleteMeta, DeleteData>
return false;
}
+ @Override
+ public void batchComplete() throws HopException {
+ commitBatch(false);
+ }
+
@Override
public void dispose() {
+ commitBatch(true);
+ super.dispose();
+ }
+ private void commitBatch(boolean dispose) {
if (data.db != null) {
try {
if (!data.db.isAutoCommit()) {
@@ -263,6 +272,7 @@ public class Delete extends BaseTransform<DeleteMeta, DeleteData>
data.db.rollback();
}
}
+ if (dispose)
data.db.closeUpdate();
} catch (HopDatabaseException e) {
logError(
@@ -272,9 +282,10 @@ public class Delete extends BaseTransform<DeleteMeta, DeleteData>
+ e.toString());
setErrors(1);
} finally {
+ if (dispose)
data.db.disconnect();
}
}
- super.dispose();
+
}
}
