Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-23794

HiveConnection.rollback always throws a "Method not supported" exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      HiveConnection.rollback automatically generated implementation always throws a generic "Method not supported" exception and thus is not compliant with the JDBC spec. For HiveConnection autoCommit mode is always on and this connection do not allow to set the autoCommit mode to false. If setAutoCommit is called and the auto-commit mode is not changed, the call is a no-op.

      Per JDBC spec, an exception can be thrown only if the connection is closed, DB access error occurs or the method is called during a transaction (which is not a case for HiveConnection).

      JDBC spec does not say a word about not supporting the method by the driver. The most correct behavior could be to throw only if the request tries to explicitly call rollback (as HiveConnection.getAutoCommit always returns true and setAutoCommit call is no-op).

      This issue is a blocker for JDBC connection pools (i.e. HikariCP) that expect JDBC-compliant behavior from the driver.

        Attachments

          Activity

            People

            • Assignee:
              amold Amol Dixit
              Reporter:
              amold Amol Dixit
            • Votes:
              3 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Due:
                Created:
                Updated: