mirror of
https://github.com/apache/sqoop.git
synced 2025-05-08 07:11:01 +08:00
SQOOP-1476: Generic JDBC Connector - DB connections not closed
(Claire Fautsch via Jarek Jarcec Cecho)
This commit is contained in:
parent
51a07bc352
commit
8fee134f7f
@ -111,6 +111,9 @@ public Schema getSchema(InitializerContext context, ConnectionConfiguration conn
|
||||
LOG.info("Ignoring exception while closing ResultSet", e);
|
||||
}
|
||||
}
|
||||
if (executor != null) {
|
||||
executor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,14 +48,17 @@ private void moveDataToDestinationTable(ConnectionConfiguration connectorConf,
|
||||
connectorConf.connection.connectionString,
|
||||
connectorConf.connection.username,
|
||||
connectorConf.connection.password);
|
||||
|
||||
if(success) {
|
||||
LOG.info("Job completed, transferring data from stage fromTable to " +
|
||||
"destination fromTable.");
|
||||
executor.migrateData(stageTableName, tableName);
|
||||
} else {
|
||||
LOG.warn("Job failed, clearing stage fromTable.");
|
||||
executor.deleteTableData(stageTableName);
|
||||
try {
|
||||
if(success) {
|
||||
LOG.info("Job completed, transferring data from stage fromTable to " +
|
||||
"destination fromTable.");
|
||||
executor.migrateData(stageTableName, tableName);
|
||||
} else {
|
||||
LOG.warn("Job failed, clearing stage fromTable.");
|
||||
executor.deleteTableData(stageTableName);
|
||||
}
|
||||
} finally {
|
||||
executor.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user