Sqoop
  1. Sqoop
  2. SQOOP-1250

Oracle connector is not disabling autoCommit on created connections

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.4
    • Fix Version/s: 1.4.5
    • Component/s: None
    • Labels:
      None

      Description

      SqlManager will always disable the autoCommit in created connection and the rest of the Sqoop is written in a way that it expects the autoCommit off by explicitly calling commit and rollback methods.

      Oracle connector currently overrides the method makeConnection without explicitly disabling the autoCommit. Depending on the Oracle JDBC driver this might or might not be an issue as:

      • Version < 12.1 will allow calling commit and rollback on a connection that have enabled autoCommit
      • Version >= 12.1 will not allow calling commit and rollback on a connection that have enabled autoCommit. We've already seen this issue in the user mailing list.

      I believe that we should set the autoCommit in the Oracle connector to false in order to make it compatible with Oracle JDBC driver version 12.1+ and also to make the connector consistent with the rest of the code base.

      Big thanks to Douglas Surber from Oracle for pointing this out!

      1. SQOOP-1250.patch
        0.8 kB
        Jarek Jarcec Cecho

        Issue Links

          Activity

          Jarek Jarcec Cecho created issue -
          Jarek Jarcec Cecho made changes -
          Field Original Value New Value
          Remote Link This issue links to "Review board (Web Link)" [ 13443 ]
          Jarek Jarcec Cecho made changes -
          Attachment SQOOP-1250.patch [ 12617070 ]
          Jarek Jarcec Cecho made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Hide
          ASF subversion and git services added a comment -

          Commit 8d3454dc60661162c1daa510c52fd60c483e3d16 in branch refs/heads/trunk from [~nrv]
          [ https://git-wip-us.apache.org/repos/asf?p=sqoop.git;h=8d3454d ]

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

          (Jarek Jarcec Cecho via Venkat Ranganathan)

          Show
          ASF subversion and git services added a comment - Commit 8d3454dc60661162c1daa510c52fd60c483e3d16 in branch refs/heads/trunk from [~nrv] [ https://git-wip-us.apache.org/repos/asf?p=sqoop.git;h=8d3454d ] SQOOP-1250 : Oracle connector is not disabling autoCommit on created connections (Jarek Jarcec Cecho via Venkat Ranganathan)
          Hide
          Venkat Ranganathan added a comment -

          Good catch and fix Jarek Jarcec Cecho. Thanks for your contribution

          Show
          Venkat Ranganathan added a comment - Good catch and fix Jarek Jarcec Cecho . Thanks for your contribution
          Jarek Jarcec Cecho made changes -
          Description {{SqlManager}} will always [disable|https://github.com/apache/sqoop/blob/trunk/src/java/org/apache/sqoop/manager/SqlManager.java#L834] the {{autoCommit}} in created connection and the rest of the Sqoop is written in a way that it expects the {{autoCommit}} off by explicitly calling {{commit}} and {{rollback}} methods.

          Oracle connector currently [overrides|https://github.com/apache/sqoop/blob/trunk/src/java/org/apache/sqoop/manager/OracleManager.java#L278] the method {{makeConnection}} without explicitly disabling the {{autoCommit}}. Depending on the Oracle JDBC driver this might or might not be an issue as:

          * Version < 12.1 will allow calling {{commit}} and {{rollback}} on a connection that have enabled {{autoCommit}}
          * Version >= 12.1 will *not* allow calling {{commit}} and {{rollback}} on a connection that have enabled {{autoCommit}}. We've already seen this issue in the [user mailing list|http://mail-archives.apache.org/mod_mbox/sqoop-user/201309.mbox/%3C20130927160509.GB22393@localhost%3E].

          I believe that we should set the {{autoCommit}} in the Oracle connector to false in order to make it compatible with Oracle JDBC driver version 12.1+ and also to make the connector consistent with the rest of the code base.
          {{SqlManager}} will always [disable|https://github.com/apache/sqoop/blob/trunk/src/java/org/apache/sqoop/manager/SqlManager.java#L834] the {{autoCommit}} in created connection and the rest of the Sqoop is written in a way that it expects the {{autoCommit}} off by explicitly calling {{commit}} and {{rollback}} methods.

          Oracle connector currently [overrides|https://github.com/apache/sqoop/blob/trunk/src/java/org/apache/sqoop/manager/OracleManager.java#L278] the method {{makeConnection}} without explicitly disabling the {{autoCommit}}. Depending on the Oracle JDBC driver this might or might not be an issue as:

          * Version < 12.1 will allow calling {{commit}} and {{rollback}} on a connection that have enabled {{autoCommit}}
          * Version >= 12.1 will *not* allow calling {{commit}} and {{rollback}} on a connection that have enabled {{autoCommit}}. We've already seen this issue in the [user mailing list|http://mail-archives.apache.org/mod_mbox/sqoop-user/201309.mbox/%3C20130927160509.GB22393@localhost%3E].

          I believe that we should set the {{autoCommit}} in the Oracle connector to false in order to make it compatible with Oracle JDBC driver version 12.1+ and also to make the connector consistent with the rest of the code base.

          Big thanks to Douglas Surber from Oracle for pointing this out!
          Jarek Jarcec Cecho made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Hudson added a comment -

          SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop100 #829 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/829/)
          SQOOP-1250: Oracle connector is not disabling autoCommit on created connections (venkat: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=8d3454dc60661162c1daa510c52fd60c483e3d16)

          • src/java/org/apache/sqoop/manager/OracleManager.java
          Show
          Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop100 #829 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/829/ ) SQOOP-1250 : Oracle connector is not disabling autoCommit on created connections (venkat: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=8d3454dc60661162c1daa510c52fd60c483e3d16 ) src/java/org/apache/sqoop/manager/OracleManager.java
          Hide
          Hudson added a comment -

          SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop200 #870 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/870/)
          SQOOP-1250: Oracle connector is not disabling autoCommit on created connections (venkat: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=8d3454dc60661162c1daa510c52fd60c483e3d16)

          • src/java/org/apache/sqoop/manager/OracleManager.java
          Show
          Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop200 #870 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/870/ ) SQOOP-1250 : Oracle connector is not disabling autoCommit on created connections (venkat: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=8d3454dc60661162c1daa510c52fd60c483e3d16 ) src/java/org/apache/sqoop/manager/OracleManager.java
          Hide
          Hudson added a comment -

          SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop23 #1066 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/1066/)
          SQOOP-1250: Oracle connector is not disabling autoCommit on created connections (venkat: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=8d3454dc60661162c1daa510c52fd60c483e3d16)

          • src/java/org/apache/sqoop/manager/OracleManager.java
          Show
          Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop23 #1066 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/1066/ ) SQOOP-1250 : Oracle connector is not disabling autoCommit on created connections (venkat: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=8d3454dc60661162c1daa510c52fd60c483e3d16 ) src/java/org/apache/sqoop/manager/OracleManager.java
          Hide
          Hudson added a comment -

          SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop20 #864 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/864/)
          SQOOP-1250: Oracle connector is not disabling autoCommit on created connections (venkat: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=8d3454dc60661162c1daa510c52fd60c483e3d16)

          • src/java/org/apache/sqoop/manager/OracleManager.java
          Show
          Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop20 #864 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/864/ ) SQOOP-1250 : Oracle connector is not disabling autoCommit on created connections (venkat: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=8d3454dc60661162c1daa510c52fd60c483e3d16 ) src/java/org/apache/sqoop/manager/OracleManager.java
          Jarek Jarcec Cecho made changes -
          Link This issue is related to SQOOP-1433 [ SQOOP-1433 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Patch Available Patch Available
          13m 14s 1 Jarek Jarcec Cecho 04/Dec/13 23:10
          Patch Available Patch Available Resolved Resolved
          22h 56m 1 Jarek Jarcec Cecho 05/Dec/13 22:06

            People

            • Assignee:
              Jarek Jarcec Cecho
              Reporter:
              Jarek Jarcec Cecho
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development