Skip to content

Commit

Permalink
[CONJ-269] handle server configuration autocommit=0
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Mar 24, 2016
1 parent 959dcd1 commit f566ca8
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,11 @@ public boolean isClosed() {
}

private void setSessionOptions() throws QueryException {
// In JDBC, connection must start in autocommit mode.
if ((serverStatus & ServerStatus.AUTOCOMMIT) == 0) {
executeQuery("set autocommit=1", false);
}
// In JDBC, connection must start in autocommit mode
// [CONJ-269] we cannot rely on serverStatus & ServerStatus.AUTOCOMMIT before this command to avoid this command.
// if autocommit=0 is set on server configuration, DB always send Autocommit on serverStatus flag
// after setting autocommit, we can rely on serverStatus value
executeQuery("set session autocommit=1", false);
if (urlParser.getOptions().sessionVariables != null) {
executeQuery("set session " + urlParser.getOptions().sessionVariables, false);
}
Expand Down

0 comments on commit f566ca8

Please sign in to comment.