5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-03 21:00:13 +08:00

SQOOP-1433: Oracle direct connector fails with Oracle 12c JDBC driver

(David Robson via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2014-09-02 09:36:41 +02:00
parent e247617063
commit f47a4fc25c
3 changed files with 8 additions and 1 deletions

View File

@ -93,7 +93,9 @@ private static Connection createConnection(String jdbcUrl, String username,
}
try {
return DriverManager.getConnection(jdbcUrl, props);
Connection result = DriverManager.getConnection(jdbcUrl, props);
result.setAutoCommit(false);
return result;
} catch (SQLException ex) {
String errorMsg = String.format(
"Unable to obtain a JDBC connection to the URL \"%s\" as user \"%s\": ",
@ -108,6 +110,8 @@ public static void initializeOracleConnection(Connection connection,
connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
connection.setAutoCommit(false);
OraOopOracleQueries.setConnectionTimeZone(connection, conf);
setSessionClientInfo(connection, conf);

View File

@ -100,6 +100,7 @@ protected Connection getTestEnvConnection() throws SQLException {
this.conn =
DriverManager.getConnection(OracleUtils.CONNECT_STRING,
OracleUtils.ORACLE_USER_NAME, OracleUtils.ORACLE_USER_PASS);
this.conn.setAutoCommit(false);
}
return this.conn;
}

View File

@ -153,6 +153,7 @@ public void importTest() throws Exception {
}
} finally {
ps.close();
conn.commit();
}
// Can't bind > 4000 bytes of data to LONG and LOB columns in the same
@ -168,6 +169,7 @@ public void importTest() throws Exception {
}
} finally {
ps.close();
conn.commit();
}
try {