Review Board 1.7.22


SQOOP-1250 Oracle connector is not disabling autoCommit on created connections

Review Request #16021 - Created Dec. 4, 2013 and updated

Jarek Cecho
SQOOP-1250
Reviewers
Sqoop
sqoop-trunk
I've added code for disabling the autoCommit in Oracle connector.
The oracle tests seems to be passing.

Diff revision 1 (Latest)

  1. src/java/org/apache/sqoop/manager/OracleManager.java: Loading...
src/java/org/apache/sqoop/manager/OracleManager.java
Revision 8008831771147ecbc9f18a699cb0351685ca8bf9 New Change
[20] 328 lines
[+20] [+] protected Connection makeConnection() throws SQLException {
329
    connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
329
    connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
330

    
   
330

   
331
    // Setting session time zone
331
    // Setting session time zone
332
    setSessionTimeZone(connection);
332
    setSessionTimeZone(connection);
333

    
   
333

   

    
   
334
    // Rest of the Sqoop code expects that the connection will have be running

    
   
335
    // without autoCommit, so we need to explicitly set it to false. This is

    
   
336
    // usually done directly by SqlManager in the makeConnection method, but

    
   
337
    // since we are overriding it, we have to do it ourselves.

    
   
338
    connection.setAutoCommit(false);

    
   
339

   
334
    return connection;
340
    return connection;
335
  }
341
  }
336

    
   
342

   
337
  public String getSessionUser(Connection conn) {
343
  public String getSessionUser(Connection conn) {
338
    Statement stmt = null;
344
    Statement stmt = null;
[+20] [20] 731 lines
  1. src/java/org/apache/sqoop/manager/OracleManager.java: Loading...