Skip to content

SQLException thrown when Connection.setAutoCommit(false) and then Connection.setAutoCommit(false); #15916

Closed
@ssainz

Description

@ssainz

SQLException is thrown when :

      Class.forName(JDBC_DRIVER);
      con = DriverManager.getConnection(DB_URL, USER, PASS);

      con.setAutoCommit(false);
      con.setAutoCommit(true); // <--- Exception here

java.sql.SQLException: Connection is in auto-commit mode
at com.facebook.presto.jdbc.PrestoConnection.commit(PrestoConnection.java:173)
at com.facebook.presto.jdbc.PrestoConnection.setAutoCommit(PrestoConnection.java:155)
at presto_jdbc.main(presto_jdbc.java:34)

These sequence of operations are common in BI Tools. Expectation is that the second setAutoCommit(true) will commit any changes and then continue without exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions