[ 
https://issues.apache.org/jira/browse/HIVE-11338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15260329#comment-15260329
 ] 

Zoltan Haindrich commented on HIVE-11338:
-----------------------------------------

HiveConnection doesn't support transactions; and having autoCommit=true is for 
communicating this; i've checked setAutoCommit()...and it already contains a 
great exception to advertise this.

{code}
  @Override
  public void setAutoCommit(boolean autoCommit) throws SQLException {
    // Per JDBC spec, if the connection is closed a SQLException should be 
thrown.
    if(isClosed) {
      throw new SQLException("Connection is closed");
    }
    // The auto-commit mode is always enabled for this connection. Per JDBC 
spec,
    // if setAutoCommit is called and the auto-commit mode is not changed, the 
call is a no-op.
    if (!autoCommit) {
      LOG.warn("Request to set autoCommit to false; Hive does not support 
autoCommit=false.");
      SQLWarning warning = new SQLWarning("Hive does not support 
autoCommit=false");
      if (warningChain == null) warningChain = warning;
      else warningChain.setNextWarning(warning);
    }
  }
{code}

> Method getAutocommit() allways returns true
> -------------------------------------------
>
>                 Key: HIVE-11338
>                 URL: https://issues.apache.org/jira/browse/HIVE-11338
>             Project: Hive
>          Issue Type: Bug
>          Components: API
>            Reporter: cristian cadar
>            Priority: Blocker
>
> Method {{getAutocommit()}} always returns {{true}}. 
> This means your connection is transacted. Please change it to {{false}}, 
> since HiveConnection does not support transactions.
> {{org.apache.hive.jdbc.HiveConnection}}
> class {{HiveConnection}}
> {code}
> @Override
>   public boolean getAutoCommit() throws SQLException {
>     return true;
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to