alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.97k stars 8.58k forks source link

Hive 的autoCommit问题 #2235

Open wseven10 opened 6 years ago

wseven10 commented 6 years ago

java.sql.SQLException: enabling autocommit is not supported at org.apache.hive.jdbc.HiveConnection.setAutoCommit(HiveConnection.java:1056) at com.alibaba.druid.filter.FilterChainImpl.connection_setAutoCommit(FilterChainImpl.java:604) at com.alibaba.druid.filter.FilterAdapter.connection_setAutoCommit(FilterAdapter.java:985) at com.alibaba.druid.filter.FilterChainImpl.connection_setAutoCommit(FilterChainImpl.java:600) at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.setAutoCommit(ConnectionProxyImpl.java:430) at com.alibaba.druid.pool.DruidConnectionHolder.reset(DruidConnectionHolder.java:280) at com.alibaba.druid.pool.DruidDataSource.recycle(DruidDataSource.java:1554) at com.alibaba.druid.pool.DruidPooledConnection.recycle(DruidPooledConnection.java:324) at com.alibaba.druid.filter.FilterChainImpl.dataSource_recycle(FilterChainImpl.java:4609) at com.alibaba.druid.filter.FilterAdapter.dataSource_releaseConnection(FilterAdapter.java:2739) at com.alibaba.druid.filter.FilterChainImpl.dataSource_recycle(FilterChainImpl.java:4605) at com.alibaba.druid.pool.DruidPooledConnection.close(DruidPooledConnection.java:267) at com.Test.main(Test.java:35)

配置项defaultAutoCommit=false 设置为true,无此问题

wenshao commented 6 years ago

hive不支持事务的哈

8debug commented 2 years ago

hive不支持事务的哈

请问,我只是解析sql语句,没有执行。为何还是报这个错误? image


java.sql.SQLException: enabling autocommit is not supported
    at org.apache.hive.jdbc.HiveConnection.setAutoCommit(HiveConnection.java:1199)
    at com.alibaba.druid.filter.FilterChainImpl.connection_setAutoCommit(FilterChainImpl.java:738)
    at com.alibaba.druid.filter.FilterAdapter.connection_setAutoCommit(FilterAdapter.java:985)
    at com.alibaba.druid.filter.FilterChainImpl.connection_setAutoCommit(FilterChainImpl.java:733)
    at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.setAutoCommit(ConnectionProxyImpl.java:430)
    at com.alibaba.druid.pool.DruidConnectionHolder.reset(DruidConnectionHolder.java:282)
    at com.alibaba.druid.pool.DruidDataSource.recycle(DruidDataSource.java:1733)
    at com.alibaba.druid.pool.DruidPooledConnection.recycle(DruidPooledConnection.java:323)
    at com.alibaba.druid.filter.FilterChainImpl.dataSource_recycle(FilterChainImpl.java:4997)
    at com.alibaba.druid.filter.stat.StatFilter.dataSource_releaseConnection(StatFilter.java:665)
    at com.alibaba.druid.filter.FilterChainImpl.dataSource_recycle(FilterChainImpl.java:4993)
    at com.alibaba.druid.pool.DruidPooledConnection.close(DruidPooledConnection.java:266)
    at org.springframework.jdbc.datasource.DataSourceUtils.doCloseConnection(DataSourceUtils.java:359)
    at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:346)
    at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:313)
    at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion(DataSourceTransactionManager.java:386)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:1007)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:793)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:714)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:534)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:305)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)