zoukankan      html  css  js  c++  java
  • java.sql.SQLException: Could not commit with auto-commit set on

    This kind of exceptions occur when the Oracle JDBC Driver (ojdbc6.jar) version 12 or above will be used. Version 12 and above of the driver is more strictly than earlier driver versions.

    You can solve the problem, you have few options:

    1. Change jar file to old version.( Below 12; usually issue occurs while migrating to new server)
    2. Override behavior of new jar version(ojdbc6.jar) with setting below JVM arguments.

      -Doracle.jdbc.autoCommitSpecCompliant=false

    3. Set Auto Commit off in Java/SQL:

      Java:

      conn.setAutoCommit(false);

      Oracle:

      SET AUTOCOMMIT OFF

    其中 第二个方法 被证实有效。

    参考 http://stackoverflow.com/questions/23953534/java-sql-sqlexception-could-not-commit-with-auto-commit-set-on-at-oracle-jdbc-d

  • 相关阅读:
    CodeForces 687B Remainders Game
    CodeForces 689D Friends and Subsequences
    CSU 1810 Reverse
    生成树收录
    吃奶酪
    带逆向思维的并查集
    中位数定理
    种类并查集(关押犯人)
    带权并查集
    分层图
  • 原文地址:https://www.cnblogs.com/SamuelSun/p/6645626.html
Copyright © 2011-2022 走看看